我收到的错误是
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 的值?我的意图是在我的主机文件中重新路由它。我已经在使用这段代码来防止主机名验证,但我相信它仍在发生。
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier()
{
public boolean verify(String hostname, SSLSession session)
{
return true;
}
});
我还将此添加到我的运行配置中以防止主机名验证
-Dweblogic.security.SSL.ignoreHostnameVerification=true
我也没有更改 SSL 证书的选项。
最佳答案
问题是主机文件条目被我后面的代理覆盖了。通过离开站点解决了问题。
关于java - HTTPS 主机名错误 : should be <xxx. xxx.xxx.xxx>,检查 URLSpoofing。传递的主机名是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16990799/