A certificates file named cacerts resides in the security properties directory, java. home \lib\security, where java.
How do I read a cacerts file in Java?
- On a Windows system, at the prompt, type: keytool -list -keystore “c:\Program Files (x86)\Java\jre<version>\lib\security\cacerts.
- On a Linux system, at the prompt, type: keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts.
How do I add a certificate to cacerts in Java?
- Locate the keystore location in the JRE. Typically this keystore is at JAVA_HOME\jre\lib\security\cacerts. …
- Run the standard keytool to import the certificate, from JAVA_HOME\jre\lib\security. …
- When prompted Enter keystore password:, enter “changeit” . …
- When prompted Trust this certificate? [no]:, enter “yes”.