[英]javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException
Previously, I could successfully send request to a web service and receive response but it now returns the following exception. 以前,我可以成功地向Web服务发送请求并接收响应,但它现在返回以下异常。 Based on other answers I need to renew the certificate but I need to know why I am receiving this exception now.
基于其他答案,我需要更新证书,但我需要知道为什么我现在收到此例外。 The other issue is that, I could find the address of my java_home but I can not renew the certificate.
另一个问题是,我可以找到我的java_home的地址,但我无法续订证书。
Exception: 例外:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
Code 码
URI uri = new URI("https", "xml.example.com", "/service/ServiceRequest.do",
"serverName=www.example.com&xml="
...
+" ", null);
URL page = uri.toURL();
HttpsURLConnection conn = (HttpsURLConnection) page.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.connect();
The problem is that you are trying to talk to a server whose SSL Certificate has expired. 问题是您正在尝试与SSL证书已过期的服务器通信。 The reason you are getting the exception is because the Java SSL code is checking the certificate chain, and has noticed the problem.
您获得异常的原因是因为Java SSL代码正在检查证书链,并且已经注意到了该问题。 A SSL certificate that has expired is not trustworthy ... and is not trusted by the default certificate validator.
已过期的SSL证书不可靠...并且不受默认证书验证程序的信任。
I can not renew the certificate ...
我无法更新证书......
Renewing the certificate is up to the owner of the website. 续订证书取决于网站所有者。 If that is not you, then there is nothing you can do ... apart from bypassing validation of the certificate, which is bad for SSL connection security.
如果那不是你,那么除了绕过证书验证之外,你无能为力......这对SSL连接安全性有害。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.