Troubleshoot Java with self-signed certificates




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: PKIX path building failed: unable to find valid certification path to requested 
Caused by: 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  \<path/to/your/trust-store.jks> \
       -jar SSLPoke-1.0.jar \
       <host-or-ip> <port>


I am trying this as I am getting a PKIX error, but I get the following response when I try the command:
Usage: sk.mhecko.ssl.SSLPoke <host> <port>


Can you try to change the order of the arguments? I think the -jar <host-or-ip> <port> should be the last arguments. If that works we should fix the run command in Step 2.


That was it. I updated the original post to match.


Thank you very much :ok_hand: