Import SSL Certificates in trust store

7 views 7:47 pm 0 Comments March 30, 2019

First download certificate in java file

[java] echo -n | openssl s_client -servername <hostname> -connect <hostname>:443 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > /tmp/key.cert[/java]

Import it using keytool command

[java]keytool -import -alias <alias> -file key.cert -keystore <keystore_location>[/java]

Java Trust store location : <JRE_HOME>/lib/security/cacerts

Leave a Reply

Your email address will not be published. Required fields are marked *