简体   繁体   English

javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException

[英]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.

相关问题 javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败google recaptcha - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed google recaptcha 线程“主”javax.net.ssl.SSLHandshakeException 中的异常:sun.security.validator.ValidatorException:未找到受信任的证书 - Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:证书签名验证失败 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Certificate signature validation failed javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX 路径构建失败 Flutter - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Flutter 解决 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed 错误? - Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error? http GET失败,错误为javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败 - http GET failed with error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:即使我已经创建了证书 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: even i have created the certificate javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败发生在一台机器上,但不在另一台机器上 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed happens on one machine, but not on the other IPG支付网关.javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:找不到可信证书 - IPG Payment Gateway.javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM