Did you just find a thisserver.crt file on your machine and you want to check the details of what it’s for? In other words you have a SSL certificate that you want to decode.
You need to be on Linux and have OpenSSL installed. Then use the x509 module:
openssl x509 -text -in thisserver.crt
Often times I’ll find myself needing to do tasks with SSL certificates using OpenSSL. I always need to look up the commands again and this takes time. I became determined to not allow that to happen again. This time I decided to write this quick cheat sheet of OpenSSL commands that I use often enough. If you happen to see a command that I use here that you know of a better way to do it, please post a comment with that information for me.
Generate a private RSA key:
openssl genrsa -out host.key 1024
openssl req -new -nodes -key host.key -out host.csrNote: Make sure that the CN (Common Name) is the FQDN of the site that this certificate is for.
Self Signed Certificate:
openssl x509 -req -days 30 -in host.csr -signkey host.key -out host.cert
openssl x509 -in filename.cert -noout -text