Apache HttpClient use own SSL-certificates

拈花ヽ惹草 提交于 2019-12-04 19:32:14

I just found the solution: We just recently switched to Java 7 and the Eclipseprojekt I used for this test still used Java 6. The Server I am working against however already uses Java 7. Running the Code above with Java 7 works for both snippets. :)

Sucks that the Exception gives no information about this, it cost me a few hours of my life :/

It may be that your TrustManager is validating the certificate, but HTTPS hostname verification is failing. Consider adding

factory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!