I am getting following error when tried to run my web services client in Weblogic Server, tried various options suggested in various sites
Certificate chain received from aa.aa.abc.com - 123.158.127.108 failed hostname verification check. Certificate contained abc.com but check expected aa.aa.abc.com
One option is to suppress the hostname verification by using following option, which is not preferred option.
-Dweblogic.security.SSL.ignoreHostnameVerification=true
Tried setting Custom Hostname verifier through weblogic Console "weblogic.security.utils.SSLWLSWildcardHostnameVerifier", still getting same error
Tried registering my Custom Hostname verifier through code by writing dummy HostName verifier
requestCtx.put("com.sun.xml.internal.ws.transport.https.client.hostname.verifier", new HostnameVerifier() { @Override public boolean verify(String hostname, SSLSession session) { return true; } });
above code did not help because weblogic seem to be using its own Http handler instead of SUN J2SE implementation, some even suggested to use "-DUseSunHttpHandler=true".
I want to know is there any better way to do programmatically/dynamically so that it will not have any impact on other applications ?