小编Jav*_*ens的帖子

SSLPeerUnverifiedException:peer未经过身份验证

再一次,SSLPeerUnverified的沉闷问题,但我没有使用自签名证书.我尝试使用https连接到主机.该主机具有正确的证书,Firefox和HttpsUrlConnection都没有任何问题.无论如何尝试使用HttpClient进行连接,我都会遇到可怕的异常.

有线索吗?或者提示哪里看得更近?

谢谢!

编辑:调试输出

main,处理异常:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)

main,getSession()中的IOException:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: 
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)

java httpclient

19
推荐指数
1
解决办法
4万
查看次数

标签 统计

httpclient ×1

java ×1