This is an old revision of the document!
Adding crt to Java cacerts
Adding crt file allows Java to access your self-signed ssl site without doing something like Insecurity HTTPS Connection.
Assume the location of your Java JDK is in C:\Program Files\Java\jdk1.8.0_131\
. The following steps add the crt to Java key store:
- Open a command console (cmd)
- cd to C:\Program Files\Java\jdk1.8.0_131\bin
- input
keytool -import -trustcacerts -keystore "c:\Program Files\Java\jdk1.8.0_131\jre\lib\security\cacerts" -storepass changeit -noprompt -alias YOUR_ALIAS -file YOUR_CRT_FILE_LOCATION.crt
- The screen should display
Certificate was added to keystore
if everything runs fine.
For the above command, YOUR_ALIAS can be anything that related to your cert you like, and YOUR_CRT_FILE_LOCATION.crt is the location of your crt file.