在使用httpclient进行https 请求访问时,报下面两种错误:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
原因是由于所访问网站的证书进行了更新,这时候只需要更新证书即可.类似如下操作:
keytool -import -noprompt -keystore test.keystore -storepass onlyStoreForTest -alias wlttesing -file e:\a.cer
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
原因是由于所访问网站的证书进行了更新,这时候只需要更新证书即可.类似如下操作:
keytool -import -noprompt -keystore test.keystore -storepass onlyStoreForTest -alias wlttesing -file e:\a.cer
本文介绍了在使用HTTPClient访问HTTPS网站时遇到的证书验证错误及其解决办法。主要针对javax.net.ssl.SSLHandshakeException和javax.net.ssl.SSLPeerUnverifiedException这两种异常情况,给出了解决方案:更新客户端信任的证书。
5611

被折叠的 条评论
为什么被折叠?



