我试图在Apache服务器上使用从StartSSL.com获得的SSL证书。与浏览器的连接良好,但是当我尝试使用Java应用程序时,我收到以下异常信息:
"Exception in thread "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"
我不明白问题可能是什么,因为在浏览器中,我得到了带有绿色标签的SSL证书。
"Exception in thread "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"
我不明白问题可能是什么,因为在浏览器中,我得到了带有绿色标签的SSL证书。
trustAll()
,以便接受所有服务器证书,包括自签名的证书。这对于某些客户端应用程序可能是可以接受的(但肯定不适用于主流浏览器!)安全威胁是一些中间人可能能够窃听甚至修改流量;但这是相当不可能的。它需要像NSA这样的资源;但我非常确定NSA无论如何都可以破解SSL :) - ZhongYu