Accept server’s self-signed ssl certificate in Java client

You have basically two options here: add the self-signed certificate to your JVM truststore or configure your client to Option 1 Export the certificate from your browser and import it in your JVM truststore (to establish a chain of trust): <JAVA_HOME>\bin\keytool -import -v -trustcacerts -alias server-alias -file server.cer -keystore cacerts.jks -keypass changeit -storepass changeit Option … Read more

Unable to find valid certification path to requested target – error even after cert imported

Unfortunately – it could be many things – and lots of app servers and other java ‘wrappers’ are prone to play with properties and their ‘own’ take on keychains and what not. So it may be looking at something totally different. Short of truss-ing – I’d try: java -Djavax.net.debug=all -Djavax.net.ssl.trustStore=trustStore … to see if that … Read more

Trust Store vs Key Store – creating with keytool

The terminology is a bit confusing indeed, but both javax.net.ssl.keyStore and javax.net.ssl.trustStore are used to specify which keystores to use, for two different purposes. Keystores come in various formats and are not even necessarily files (see this question), and keytool is just a tool to perform various operations on them (import/export/list/…). The javax.net.ssl.keyStore and javax.net.ssl.trustStore … Read more