Adding Custom Certificate to an Application Specific Trusted Store
Reference :
https://help.zscaler.com/zia/adding-custom-certificate-application-specific-trusted-store#java
Java
To import a custom certificate for Java:
- Download the certificate bundle in DER format to the
JAVA_HOME/bindirectory using the keytool utility.
To convert a .crt certificate to DER format, use the command, openssl x509 -in <filename.pem> -inform pem -out <filename.der> -outform der
- Run the following keytool command for your certificate:
keytool -import -trustcacerts -alias <certAlias> -file <certFile> -keystore <trustStoreFile>
For example:
keytool -import -trustcacerts -alias zscalerrootca -file zscalerrootca.der -keystore $JAVA_HOME/jre/lib/security/cacerts
- You may be prompted to enter a password if you are running the tool for the first time.
- Enter
yesto confirm. - Verify if the certificate is imported successfully using the following keytool command:
keytool -list -v -keystore cacerts
To learn more about keytool commands, see Oracle documentation.
Comments
Post a Comment