Weblogic SSL Hostname Verifier

Issue:

javax.net.ssl.SSLKeyException: Hostname verification failed: HostnameVerifier=weblogic.security.utils.SSLWLSHostnameVerifier, hostname=myserver.mydomain.com.
at weblogic.security.SSL.jsseadapter.JaSSLEngine.doPostHandshake(JaSSLEngine.java:677)
at weblogic.security.SSL.jsseadapter.JaSSLEngine.doAction(JaSSLEngine.java:748)
at weblogic.security.SSL.jsseadapter.JaSSLEngine.unwrap(JaSSLEngine.java:132)
at weblogic.socket.JSSEFilterImpl.unwrap(JSSEFilterImpl.java:611)
at weblogic.socket.JSSEFilterImpl.unwrapAndHandleResults(JSSEFilterImpl.java:515)
at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:98)
at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:77)
at weblogic.socket.JSSESocket.startHandshake(JSSESocket.java:240)
at weblogic.net.http.HttpsClient.New(HttpsClient.java:574)
at weblogic.net.http.HttpsClient.New(HttpsClient.java:545)
at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:230)

Diagnosis:

Due to wildcard in the host certificate.

Resolution:

The default hostname verifier in weblogic does not support wildcard certificate, and need to use the wildcard verifier as below:

  1. Go to the WebLogic admin console -> Environment -> Servers -> your server -> Configuration -> SSL
  2. Click “Lock & Edit”
  3. Open the “Advanced” flap
  4. Change “Hostname Verification” from “BEA Hostname Verifier” to “Custom Hostname Verifier”
  5. Set “Custom Hostname Verifier” to security.utils.SSLWLSWildcardHostnameVerifier
  6. Click “Save” and then “Activate Changes”
  7. Restart your server.

 

References:

http://serverfault.com/questions/503751/certificate-verification-error-when-sending-a-service-request-from-weblogic

http://docs.oracle.com/cd/E28280_01/web.1111/e13707/ssl.htm#SECMG571

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s