Importing a self signed certificate to java cacert trust store
The following steps to be used only in non production environments. Self signed certificates could be used in some organisations to make server to server calls between java programs on SSL. During these situations, we can import the certificate from the server jvm to client's jvm to fix the SSL handshake issue. On Server JVM: Generate a self signed certificate keytool -genkey -noprompt -alias test.example.com -dname "CN=localhost, OU=Team Name, O=Organisation Name, L=London, S=Greater London, C=UK" -ext "san=dns:test.example.com,dns:test.example.org" -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore /tmp/keystore.p12 -validity 36500 -storepass mypassword -keypass mypassword List the certificate keytool -list -keystore /tmp/keystore.p12 -storepass mypassword -storetype PKCS12 -v Export the certificate keytool -exportcert -keystore /tmp/keystore.p12 -storetype PKCS12 -storepass mypassword -alias localhost -file /tmp/test.example.com.crt On...