I have a Java JAR application which connects to the Java web service running on a server behind HTTPS. If I run the JAR with Oracle Java 1.6, then the SSL handshake is successful. However, If I run it with Oracle Java 1.7 or newer, I always get the exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I have imported the certificates to the cacert
file, and have used VM variable javax.net.ssl.trustStore
to set the path to the file.
I have found out that there are differences in jsse.jar in different Java version.
Also, this application works like expected on a Unix machine which has IBM version of Java installed: IBM J9 VM (build 2.7, JRE 1.7.0
And, it works correctly with IBM JRE on Widnows:
IBM J9 VM (build 2.8, JRE 1.8.0)
What could I do to fix this?