且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2021-07-11 05:58:29

您需要为 App2添加证书到位于%JAVA_HOME%\lib\security \ cacerts 的已使用JVM的truststore文件。

You need to add the certificate for App2 to the truststore file of the used JVM located at %JAVA_HOME%\lib\security\cacerts.

首先,您可以通过运行以下命令来检查您的证书是否已经在信任库中:
keytool -list -keystore%JAVA_HOME%/ jre / lib / security / cacerts (您无需提供密码)

First you can check if your certificate is already in the truststore by running the following command: keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts" (you don't need to provide a password)

如果您的证书丢失,您可以通过浏览器下载它来获取它并使用以下命令将其添加到信任库:

If your certificate is missing, you can get it by downloading it with your browser and add it to the truststore with the following command:

keytool -import -noprompt -trustcacerts -alias< AliasName> -file< certificate> -keystore< KeystoreFile> -storepass<密码>

您可以再次运行第一个命令来检查您的证书是否已添加。

Afer import you can run the first command again to check if your certificate was added.

可以在找到Sun / Oracle信息这里