Java Import TLS Certificate
Install a root certificate on Java
Extract root certificate from the website
openssl s_client -connect $DOMAIN:$PORT < /dev/null 2>/dev/null | openssl x509 -outform PEM >/etc/ssl/mycert.pemImport the root certificate into the keystore
sudo keytool -import -alias mycert -keystore $JAVA_HOME/jre/lib/security/cacerts -file /etc/ssl/mycert.pemEnter the password for the keystore
changeitVerify the certificate is in the keystore
sudo keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts
Last modified: 09 January 2024