Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error?

后端 未结 22 2918
名媛妹妹
名媛妹妹 2020-11-21 05:59

Edit :- Tried to format the question and accepted answer in more presentable way at mine Blog

Here is the original issue.

22条回答
  •  轮回少年
    2020-11-21 06:15

    You need to add the certificate for App2 to the truststore file of the used JVM located at %JAVA_HOME%\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 -file -keystore -storepass

    Example:
    keytool -import -noprompt -trustcacerts -alias myFancyAlias -file /path/to/my/cert/myCert.cer -keystore /path/to/my/jdk/jre/lib/security/cacerts/keystore.jks -storepass changeit

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

    Sun/Oracle information can be found here.

提交回复
热议问题