3 comments
Sort by
Date
Votes
When accessing the site with https using Get_Url you may run into an error similar to this:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
This means Java is trying to access a URL but doesn't have the correct or up to date certificate. Do the following steps if you have access:
- 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 trus 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
Please sign in to leave a comment.