我与之交谈的网络服务器更新了其 SSL 证书,现在我的应用程序无法与其交谈
网络服务器将其 SSL 证书更新为新的 verisign 签名证书,并且我的 java 应用程序无法再连接。
我正在使用 java 5,其证书文件的日期为 2006 年 11 月,位于 /usr/java/jre/lib/security
我得到了
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 安装。上次我不需要安装任何证书即可使其正常工作。
The webserver updated its SSL cert to a new verisign signed cert and my java app can no longer connect.
I am using java 5 with a date on the cert file Nov 2006 in /usr/java/jre/lib/security
I get
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)
How do I install a new key supplied by the server?
From a different java instance I get
Certificate chain received from eservices3.bus.att.com - 135.38.253.93 was not trusted causing SSL handshake failure.
I assume that it is from the same root problem.
Update Before the remote server was updated this worked with our standard java install. I didn't have to install any certs to get this to work last time around.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Java 尝试通过跟踪服务器提供的证书链来验证证书,直到找到它信任的证书(即
cacerts
文件中存在的证书)。我们可以使用 OpenSSL 命令行工具手动验证链:
现在,问题是:颁发者(以
i:
开头的行)“VeriSign Class 3 Secure Server CA - G3”是中间证书,而不是一个根。 AT&T 服务器配置错误,应该发送自己的证书(“eservices3.bus.att.com”)和中间证书,以便 Java 可以一直验证链到根。为了说明另一种方式,该链应如下所示:
cacerts
中 - 好的,要解决此问题,您可以:
第一个解决方案是更好的选择,因为它可以帮助每个人(不仅仅是您)并且风险稍小(您可能不会注意到中间证书是否被泄露)。
如果您想导入证书作为临时措施,请从 VeriSign 的支持页面(它是“辅助 SSL 中间 CA 证书”),然后:
要删除该证书(一旦 AT&T 齐心协力):
Java tries to validate the certificate by following the chain of certificates presented by the server, until it finds one it trusts (i.e. one that's present in your
cacerts
file).We can verify the chain manually using the OpenSSL command line tools:
Now, here's the problem: the issuer (line beginning
i:
) "VeriSign Class 3 Secure Server CA - G3" is an intermediate certificate, not a root. The AT&T server is misconfigured, and should be sending both its own certificate ("eservices3.bus.att.com") and the intermediate, so that Java can verify the chain all the way to the root.To illustrate another way, the chain should look like this:
cacerts
- okTo fix this, you can either:
The first solution is preferable, since it helps everyone (not just you) and is slightly less risky (you might not notice if the intermediate cert became compromised).
If you want to import the cert as a temporary measure, grab it from VeriSign's support pages (it's "Secondary SSL Intermediate CA Certificate"), then:
To remove the cert (once AT&T get their act together):
听起来好像您的服务器(或应用程序,但更可能是服务器)不信任 verisign 颁发此新证书的根证书。一旦您信任该证书,您就会信任与其关联的所有证书。
可以在以下链接找到 verisign 根 CA:
http://www.verisign.com/support /roots.html
It sounds as though your server (or application, but more likely the server) doesn't trust the root certificate that verisign has issued this new certificate from. Once you trust that cert, you'll trust all the certs chained to it.
The verisign root CAs can be found at the below link:
http://www.verisign.com/support/roots.html