HTTPS主机名错误:应为<xxx.xxx.xxx.xxx>,checkURLSpoofing。传递的主机名是什么?</xxx.xxx.xxx.xxx>

时间:2013-06-07 18:37:37

标签: java web-services ssl

我收到的错误是

com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.io.IOException: HTTPS hostname wrong:  should be <xxx.xxx.xxx.xxx>
    at sun.net.www.protocol.https.HttpsClient.checkURLSpoofing(HttpsClient.java:524)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:448)

我的问题是,如何获取传递给checkURLSpoofing的值?我的意图是在我的hosts文件中重新路由它。我已经在使用这段代码来阻止主机名验证,但我相信它仍在发生。

 HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier()
 {
     public boolean verify(String hostname, SSLSession session)
     {               
         return true;
     }
 });

我还将此添加到我的运行配置中以防止主机名验证

-Dweblogic.security.SSL.ignoreHostnameVerification=true

我也没有选择更改SSL证书。

1 个答案:

答案 0 :(得分:0)

问题是我所在的代理正在覆盖hosts文件条目。离开现场解决了这个问题。