The error below means Java is trying to access a URL but doesn't have the correct or up to date certificate.
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
To fix this issue:
- Obtain the certificate from the application owners. It could be your IT department or app developers.
- Add the certificate for the target application to the truststore file of the JVM located at
%JAVA_HOME%\lib\security\cacerts
- You can always check if the certificate is already in the trust store by running the following command:
keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts
- If the certificate is not showing, download it from your browser and add it to the trust store:
keytool -import -noprompt -trustcacerts -alias <AliasName> -file <certificate> -keystore <KeystoreFile> -storepass <Password>
- Check the trust store to see your certitifcate:
keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts"
Here is a reference for trust store and certificates in Oracle JDK: https://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html
Comments
Please sign in to leave a comment.