By Alvin Alexander. Last updated: June 17, 2018
In case you ever need to manually a certificate to your ${JAVA_HOME}/jre/lib/security/cacerts file, it turns out the password for that file when using the Java keytool
command is changeit.
To add a certificate to that file, you’ll want to use a command like this:
keytool \ -import \ -alias "foobar.com" \ -keystore ${JAVA_HOME}/jre/lib/security/cacerts \ -file foobar.com.crt
I had to do this today for a Java/Scala script that accesses an HTTPS URL, and the site I’m accessing uses a “Let’s Encrypt” certificate.