← Guides

How to check when an SSL certificate expires

Updated 2026-11-22. Sources are listed at the end.

A certificate's expiry date is its notAfter field. The browser, openssl and curl show the certificate a server presents right now. Certificate Transparency (CT) logs show what was issued, including certificates for hostnames you may have forgotten.

1. In your browser

  1. Open the site over HTTPS.
  2. Click the icon to the left of the address (a padlock or a "site information" icon).
  3. Open the connection or certificate details and look for "Expires on" or "Valid to".

Menu names differ between browsers and versions. This works for one site at a time and only for the hostname you opened.

2. With openssl

This connects to the server and prints the expiry date of the certificate it presents:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate

The output looks like notAfter=Feb 20 23:59:59 2027 GMT. The -servername option sends the hostname (SNI). Without it, a server that hosts many sites may return its default certificate, and you would be checking the wrong one.

To make a script warn you when a certificate expires within 30 days (2,592,000 seconds), use -checkend. It exits with a non-zero status if the certificate will expire within that time:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -checkend 2592000 || echo "Renew soon: example.com"

For a certificate file on disk:

openssl x509 -in /path/to/cert.pem -noout -enddate

For a mail server that uses STARTTLS:

echo | openssl s_client -starttls smtp -connect mail.example.com:587 -servername mail.example.com 2>/dev/null | openssl x509 -noout -enddate

3. With curl

curl -svI https://example.com 2>&1 | grep -i "expire date"

curl prints certificate details in verbose mode when it is built with OpenSSL. With other TLS libraries the line may look different or be missing, so use openssl if a script depends on the format.

4. In Certificate Transparency logs

Publicly trusted certificate authorities log the certificates they issue. Searching the logs for your domain lists certificates with their "Not After" dates, including ones for staging sites, old landing pages, mail or VPN hosts. CT shows what was issued, not what a server presents: a renewed certificate that was never installed still appears. See how to search CT logs for your domain.

Checking many hostnames regularly

Run the -checkend command from a scheduled job for every hostname that has its own certificate (www, api, mail, VPN, staging), not only the main site, and send the output somewhere you will read it.

Let's Encrypt stopped sending expiry reminder emails on 4 June 2025. Its notice points to third-party services and names Red Sift Certificates Lite, which it describes as free for up to 250 certificates.

Doing this for many domains?

Lindenkit runs the CT search for every domain you add and reminds you before the latest logged certificate expires, with one email for many client domains.

Lindenkit Certificates lists the certificates logged in public Certificate Transparency logs for each domain you add, tracks the domain's registration expiry through RDAP, and emails you 30, 14, 7 and 1 days before either lapses. It reads public data and does not connect to your servers, so it shows the latest certificate per CT logs, which may not be the one a server presents. Free for up to 10 certificates; Base US$29/month for 100.

How Lindenkit Certificates works Try the free checker

Sources