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
In the left pane of the console, double-click Certificates (Local Computer). Right-click Personal, point to All Tasks, and then select Import. On the Welcome to the Certificate Import Wizard page, select Next. On the File to Import page, select Browse, locate your certificate file, and then select Next.
# Copy the certificate into the directory Java_home\Jre\Lib\Security # Change your directory to Java_home\Jre\Lib\Security> # Import the certificate to a trust store. keytool -import -alias ca -file somecert.cer -keystore cacerts -storepass changeit [Return] Trust this certificate: [Yes]
changeit is the default truststore password
Instead of using sed
to filter out the certificate, you can also pipe the openssl s_client
output through openssl x509 -out certfile.txt
, for example:
echo "" | openssl s_client -connect my.server.com:443 -showcerts 2>/dev/null | openssl x509 -out certfile.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With