简体   繁体   English

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

I am trying to integrate an API with a Spring Application deployed in a Tomcat. 我正在尝试将API与部署在Tomcat中的Spring应用程序集成。 In order to integrate with that API I just make a GET HTTP on a link to retrieve data from that link, but I receive an error like this: 为了与该API集成,我只需在链接上创建GET HTTP以从该链接检索数据,但是我收到如下错误:

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 sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)

You API must be on SSL. 您的API必须在SSL上。 You need to configure the SSL certificate/keystore in the tomcat. 您需要在tomcat中配置SSL证书/密钥库。

For example: 例如:

-Djavax.net.ssl.trustStore=C:\keystore\.keystore
-Djavax.net.ssl.trustStorePassword=changeit

Alternatively, you can add your certificate to Java cacert. 或者,您可以将证书添加到Java cacert。

Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error? 解决javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败错误?

Refer detailed GUIDE and follow these steps 请参阅详细指南并按照以下步骤操作

  1. get root certificate of your network 获取您的网络的根证书
  2. install that certificate to java cacerts of your jre. 将该证书安装到jre的java cacerts中。

NOTE 注意

  1. you are supposed to install your certificate to PATHTOYOURJDK/jre/lib/cacerts. 你应该将你的证书安装到PATHTOYOURJDK / jre / lib / cacerts。
  2. If you have multiple jdk please confirm you are installing certificate to that particular jre only which your application or code is using. 如果您有多个jdk,请确认您正在将证书安装到您的应用程序或代码所使用的特定jre。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解决 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? 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 路径构建失败 Flutter - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Flutter 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:PKIX路径构建失败发生在一台机器上,但不在另一台机器上 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed happens on one machine, but not on the other 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:证书签名验证失败 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Certificate signature validation failed javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException 关于sun.security.validator.ValidatorException:PKIX路径构建失败 - Regarding sun.security.validator.ValidatorException: PKIX path building failed 获取sun.security.validator.ValidatorException:PKIX路径构建失败: - getting sun.security.validator.ValidatorException: PKIX path building failed:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM