Has anyone came across where they have to deal with .truststore file? and knowing how to import .cer into .truststore file?
I am not sure if I have to use Java Keytool or Linux command (such as openssl command).
Thanks
Has anyone came across where they have to deal with .truststore file? and knowing how to import .cer into .truststore file?
I am not sure if I have to use Java Keytool or Linux command (such as openssl command).
Thanks
The question is how to import a .cer file into the trust store, but I have a .crt file, which I exported from Firefox.
Searching the internet how to import .crt to trust store points to this question. Since I found out how to import the .crt in the trust store I answer that too.
The answer is: the same as for .cer files.
By the way, you do not have to put an alias and the password of the keystore can be typed after you enter the command:
Preferably use the cacerts file that is already in your Java installation (jre\lib\security\cacerts) as it contains already secure "popular" certificates.
Update regarding the differences of cer and crt (just to clarify) According to Apache with SSL - How to convert CER to CRT certificates? and user @Spawnrider
changeit is the default truststore password
Instead of using
sed
to filter out the certificate, you can also pipe theopenssl s_client
output throughopenssl x509 -out certfile.txt
, for example: