openssl x509 -in cert.pem -noout -dates

Category: Security & Hardening

openssl x509 -in cert.pem -noout -dates

Show a certificate's validity period

Prints notBefore and notAfter, the exact timestamps when the certificate becomes valid and expires. Expired certificates break TLS handshakes, so check this before troubleshooting connectivity. The related form with -enddate shows only the expiry date.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.