httpclient请求报No trusted certificate found, peer not authenticated 解决方案

在使用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


你可能感兴趣的:(.net,Security,sun)