Checking certificate expiry using openssl

May 25, 2019

The following command will connect to a TLS endpoint using OpenSSL and return the expiry date for the certificate for that endpoint.

openssl s_client -connect HOST:PORT 2>/dev/null <<< "Q" | openssl x509 -text | grep "Not After :"