Search This Blog

Total Pageviews

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 target

This means that the web server or URL you are connecting to does not have a valid certificate from an authorized CA.

To fix this:
      Import the server certificate and install it in your JRE Keystore.
How to get the Certificate:
       Logon to the URL using browser (IE)
       When you notice the warning dialog box, save the certificate to your local directory as .cer file
How to add to KeyStore: (Java keytool is a command-line utility to manage certificates)
       keytool –import
How to delete the Certificate in KeyStore:
       keytool –delete     
What is the default KeyStore Password:
How to list all the certificates in your keystore:
       Keytool -list

No comments:

How to generate Digital Certificate?

keytool -genkey -v -keystore c:\Users\<user>\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key