To accept a server's self-signed SSL certificate in a Java client, you can create a custom javax.net.ssl.X509TrustManager and use it to override the default trust manager.
To find out which keystore the Java Virtual Machine (JVM) is using, you can use the javax.net.ssl.KeyManagerFactory class and the getDefaultAlgorithm method.
If you are getting the "unable to find valid certification path to requested target" error even after importing the certificate, there are a few possible causes and solutions:<br>