Check the expiration date of an SSL certificate

Troubleshoot certificate issues by checking the expiration of the certificate.

How to

  1. Open a UNIX command line window.
  2. Perform a query such as, openssl s_client -servername <NAME> -connect <HOST:PORT> 2>/dev/null | openssl x509 -noout -dates.
    The expiration date appears in the response as notAfter=<expiration_date>


For example, if the HOST is, PORT is 443, using the openssl command, you can see the expiration date is Nov 21, 23:59:59 minutes in 2021.