How to avoid Java SSL certificate Error
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 normally happens when we are using the user-generated-certificates instead of the certificate generated by Certification Authorities. So to avoid this download and run this little java program
http://blogs.sun.com/andreas/resource/InstallCert.java
java InstallCert myserver.xyz.com . Here myserver.xyz.com is your server hostname
It downloads the certificate and asks whether to add it to the keystore
Enter certificate to add to trusted keystore or ‘q’ to quit: [1]
press Enter
this will generate the file jssecacerts in the current directory . Copy it to $JAVA_HOME/jre/lib/security . Hooray … no more exception
For detailed information see the blog of andreas http://blogs.sun.com/andreas/entry/no_more_unable_to_find
Related Links
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html

Leave a Reply