Commands to Check SSL cert’s validity and other details

1. Get complete available details of an SSL certificate

openssl x509 -text -in ssl.cert 2. Who issued the certificate?

openssl x509 -noout -in ssl.cert -issuer

3. To whom the certificate was issued?

openssl x509 -noout -in ssl.cert -subject

4. To check the expiry date of SSL certificate

openssl x509 -noout -in ssl.cert -dates

5. To get SSL cert’s hash value

openssl x509 -noout -in ssl.cert -hash

6. To get SSL cert’s MD5 fingerprint

openssl x509 -noout -in ssl.cert -fingerprint

To check CSR: openssl req -noout -text -in new.csr 

To check key: openssl rsa -noout -text -in new.key 
    • shan
    • March 17th, 2012

    Awesome stuff. Could I ask some doubts regarding the SSL. How can we check the CRT a valid one or not.

    I’ll explain the scenario. Last dat, I have installed SSL using WHM, but it gives me error when I call the site with https.

    • You should use the SSL Checker site at It will tell you if you are missing intermediate or CA Root certificates in your certificate chain, or if you have other issues such as the incorrect SSL Certificate selected, for the site configuration.

  1. Hi Shan,

    You can check the certificate validity using

    openssl x509 -noout -in ssl.cert -dates

    Replace ssl.cer in the above command with the SSL certs file name.

    I your case, I’m not sure what exact error you got after installing SSL.

    • Hansy
    • March 28th, 2012

    Will try it.

    • Velan
    • May 7th, 2013

    Is there a way to edit the expiry date of the certs ?

    • No. You you would need to reissue the certificate or request a new one.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: