You try to access SSL secured services using self-signed certificates with a Java application. You can’t access the service and you get an exception:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested . . Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target . . -
To diagnose if your certificate is correctly stored in a trust store file, you can use SSLPoke to test if a connection with your custom trust store can be established.
Step 1: Download the SSLPoke executable jar file
Step 2: Run the command and test if you can establish a connection
java -Djavax.net.debug=ssl \ -Djavax.net.ssl.trustStore=<path/to/your/trust-store.jks> \ -jar SSLPoke-1.0.jar \ <host-or-ip> <port>