title: hostname verification in weblogic
body: <p>I am getting following error when tried to run my web services client in Weblogic Server, tried various options suggested in various sites </p>
  
  <p>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</p>
  
  <ol>
  <li><p>One option is to suppress the hostname verification by using following option,
  which is not preferred option.</p>
  
  <p>-Dweblogic.security.SSL.ignoreHostnameVerification=true </p></li>
  <li><p>Tried setting Custom Hostname verifier through weblogic Console    "weblogic.security.utils.SSLWLSWildcardHostnameVerifier", still getting same error</p></li>
  <li><p>Tried registering my Custom Hostname verifier through code by writing dummy HostName verifier</p>
  
  <pre><code> requestCtx.put("com.sun.xml.internal.ws.transport.https.client.hostname.verifier", new HostnameVerifier() {
  
                                  @Override
                                  public boolean verify(String hostname,
                                          SSLSession session) {
                                      return true;
                                  }
                              });     
  </code></pre>
  
  <p>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".</p></li>
  </ol>
  
  <p>I want to know is there any better way to do programmatically/dynamically so that it will not have any impact on other applications ?</p>