How to check SSL certificate expiry for many domains
An expired certificate takes a site down for every visitor, and it usually happens on a domain nobody watches: an old landing page, a client site, a staging host. Here's how to check dozens or thousands of domains at once.
One domain: the command line
echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -noout -enddate
This prints notAfter=, the expiry date. In a browser, click the padlock → certificate details.
A list of domains: a small script
while read d; do end=$(echo | openssl s_client -servername "$d" -connect "$d:443" 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2) echo "$d,$end" done < domains.txt > expiry.csv
Works, but you need to run it yourself, handle timeouts, and remember to run it again next month.
Bulk, scheduled, with alerts (no code)
Our Security Headers & SSL Certificate Audit takes a list of domains and, for each one, reports days until the certificate expires, whether HTTP redirects to HTTPS, and which security headers are missing. Every site gets a 0–100 score and an A–F grade.
- Paste your domains (up to 500 per run).
- Set the warning threshold, e.g. 21 days.
- Turn on "only report problems" to get a short list.
- Schedule it weekly and connect email or Slack.
Price: about $4 per 1,000 sites checked.
Don't forget the headers
While you're checking certificates, make sure HSTS and the other security headers are set. Our free security headers generator writes the config for Nginx, Apache, Netlify, Vercel and Cloudflare.