how to Check SSL Certificate Expiration Date in Centos/Rhel 6&7

In previous blog, I shared “How to install Comodo Positive SSL Certificate on zpanel/sentora in Centos/Linux 6.x-7.x” link is https://www.natsav.com/blog/2017/09/22/install-comodo-ssl-zpanel-centos/ and in this blog I will show how to Check SSL Certificate Expiration Date.

The command is very useful to check an ssl certificate expiry date. Before the command you have to know about for server.crt file location like /etc/pki/tls/certs/ natsav.crt (natsav.crt replace from your *.crt file name)

Step1. Login to your server with root access or sudo user

Step2. If you don’t know the location of the server.crt file than run below command

#find /etc -name natsav.crt   (for root user)
                    or
#sudo find /etc -name natsav.crt (for sudo user)

Step3. Run the command for ssl certificate expiry date

# openssl x509 -noout -dates -in /path/to/natsav.crt  (for root user)
                          or
# sudo openssl x509 -noout -dates -in /path/to/natsav.crt (for sudo user)

output of the command 

notBefore=Sep 14 00:00:00 2015 GMT

notAfter=Sep 13 23:59:59 2020 GMT

Leave a Reply

Your email address will not be published. Required fields are marked *