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 targetIt was thrown because Java was unable to verify the validity of the certificate. In your web browser it might warn you that the certificate is untrusted and you’re still be able to add the certificate to a trusted list. But in Java, you’ll have to use a keytool to do the same thing.
You can find the keytool in your Java jdk bin directory. After you located your keytool, follow the steps:
- Download your server certificate to your local machine
- Insert to your Java cacerts by executing the keytool with some parameters:keytool -keystore ..\jre\lib\security\cacerts -import -alias anyaliasyoulike -file c:\path\to\your.crt -trustcacerts
- Keystore password: changeit
Quick tip:
- To list all the certificate in keystorekeytool -list -keystore ..\jre\lib\security\cacerts
- To remove certificate from keystorekeytool -delete -alias certalias -keystore ..\jre\lib\security\cacerts
No comments:
Post a Comment