网络服务器将其SSL证书更新为新的verisign签名证书,我的Java应用程序无法再连接。
我在2006年11月的/ usr / java / jre / lib / security
中使用带有日期的java 5我得到了
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
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1518)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:848)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:818)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1030)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1057)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1041)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
如何安装服务器提供的新密钥?
从我得到的另一个java实例
Certificate chain received from eservices3.bus.att.com - 135.38.253.93 was not trusted causing SSL handshake failure.
我认为它来自同一根问题。
更新在远程服务器更新之前,这适用于我们的标准Java安装。我没有必要安装任何证书,以便上次使用它。
答案 0 :(得分:12)
Java尝试通过遵循服务器提供的证书链来验证证书,直到找到它信任的证书(即cacerts
文件中存在的证书)。
我们可以使用OpenSSL命令行工具手动验证链:
simon@lucifer:~$ openssl s_client -connect eservices3.bus.att.com:443 <snipped> --- Certificate chain 0 s:/C=US/ST=Georgia/L=Alpharetta/O=ATT Services, Inc./OU=ATTIT/CN=eservices3.bus.att.com i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 Secure Server CA - G3 ---
现在,问题在于:发行者(行开始i:
)“VeriSign Class 3安全服务器CA-G3”是中间证书,而不是根证书。 AT&amp; T服务器配置错误,应该发送自己的证书(“eservices3.bus.att.com”)和中间件,以便Java可以一直验证链路到根
为了说明另一种方式,链应如下所示:
1) VeriSign Class 3 Public Primary Certification Authority - G5 (root) ^ | signed by | 2) VeriSign Class 3 Secure Server CA - G3 (intermediate) ^ | signed by | 3) eservices3.bus.att.com (server)
cacerts
- 确定要解决此问题,您可以:
第一种解决方案更可取,因为它可以帮助每个人(不仅仅是你)并且风险稍低(如果中间证书受到损害,您可能不会注意到这一点)。
如果要将证书作为临时措施导入,请从VeriSign's support pages(它是“辅助SSL中间CA证书”)中获取它,然后:
simon@lucifer:~$ keytool -importcert -alias some_alias_of_your_choosing \ -file intermediate_cert_path.crt \ -keystore your_cacerts_path Enter keystore password: ***** Certificate was added to keystore
删除证书(一旦AT&amp; T一起行动):
simon@lucifer:~$ keytool -delete -alias same_alias_as_before \ -keystore your_cacerts_path
答案 1 :(得分:0)
听起来好像您的服务器(或应用程序,但更可能是服务器)不信任verisign已颁发此新证书的根证书。一旦您信任该证书,您就会信任所有链接到它的证书。
可以在以下链接中找到verisign根CA: