Query port 443 directly with openssl s_client for live TLS expiry and pull registrar dates from RDAP in Python, then run both on cron with webhook alerts.
Monitor SSL and Domain Expiry Across Client Sites Without a Vendor Dashboard
Build a vendor-free SSL and domain expiry monitor with OpenSSL, RDAP, and cron alerts to catch stalled reloads and 200-day TLS lifecycle changes.
// The short answer
In this guide · 6 sections
Relying solely on internal ACME automation to keep your client sites secure leaves you open to a nasty blind spot where a silently broken cron job looks identical to a normal renewal. Putting together an external, vendor-free monitoring pipeline with standard Linux tools lets you spot validation errors, stuck server reloads, and domain registrar changes long before your visitors see a browser warning.
| Specification | Operational Detail |
|---|---|
| Max SSL Validity (Since Mar 15, 2026) | 200 days |
| Upcoming SSL Limits | 100 days (Mar 2027), 47 days (Mar 2029) |
| Required Stack | openssl, curl, python3, cron |
| SSL Check Method | Remote TLS Handshake (Port 443) |
| Domain Check Method | RDAP API (Registration Data Access Protocol) |
Why Auto-Renewed Certificates Still Cause Outages
Just because an automation script downloads a fresh certificate doesn't mean your visitors are actually getting a secure connection. When a live site goes down over an SSL or domain issue, it almost always comes down to one of these mechanical hiccups:
- Stalled Server Memory: Your ACME client (like Certbot) saves the new
.pemfiles to disk without a hitch, but the post-hook script fails to runsystemctl reload nginx. Meanwhile, your web server happily keeps serving the expired certificate still sitting in its memory. - DNS Validation Breakages: A client switches DNS providers or deletes what they think are "unused" TXT or CNAME records, quietly breaking the ACME DNS-01 challenge you need for the next wildcard renewal.
- Payment and Registrar Lapses: The SSL certificate itself is good for another 60 days, but the actual domain expires because the renewal notice went to an old employee's inbox.
- CDN vs. Origin Mismatch: The edge network (Cloudflare, Fastly) auto-renews its own edge certificate just fine, but the strict origin pull breaks because the certificate on your backend server expired, leaving users staring at a 526 error.
The Shrinking Validity Lifecycle: 200, 100, and 47 Days
Your margin for error with certificate management is getting tighter by the year. Under the CA/Browser Forum Baseline Requirements, the maximum lifespan for a publicly trusted TLS certificate is strictly capped and shrinking fast:
- 15 March 2026: Maximum validity dropped to 200 days.
- 15 March 2027: Maximum validity drops to 100 days.
- 15 March 2029: Maximum validity drops to 47 days, with domain validation reuse capped at just 10 days.
Once we hit a 47-day lifespan, you’re looking at a minimum of eight renewals a year for every single client. At that pace, trying to track SSL renewals manually on a calendar simply won't scale. External monitoring is non-negotiable if you want to catch the inevitable automation misfires.

Build the Expiry Monitor Scripts
Shell Script: Read Live Certificate Expiry via OpenSSL
To know what a visitor's browser actually sees, you have to pull the certificate straight from the live port via a TLS handshake. Checking local file timestamps on the server won't cut it.
Set up a shell script (check_ssl.sh) that pings the live domain, grabs the notAfter date, and works out how many days are left:
#!/usr/bin/env bash
DOMAIN=$1
PORT=${2:-443}
# Extract the expiration date using s_client
EXPIRY_DATE=$(echo | openssl s_client -servername "$DOMAIN" -connect "$DOMAIN":"$PORT" 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2)
if [ -z "$EXPIRY_DATE" ]; then
echo "Error: Could not retrieve certificate for $DOMAIN"
exit 1
fi
# Convert dates to seconds for calculation
EXPIRY_EPOCH=$(date -d "$EXPIRY_DATE" +%s)
CURRENT_EPOCH=$(date +%s)
DAYS_LEFT=$(( (EXPIRY_EPOCH - CURRENT_EPOCH) / 86400 ))
echo "$DOMAIN SSL expires in $DAYS_LEFT days"
if [ "$DAYS_LEFT" -lt 15 ]; then
# Insert your webhook alert here
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"🚨 SSL Alert: '"$DOMAIN"' expires in '"$DAYS_LEFT"' days!"}' \
YOUR_WEBHOOK_URL
fiPython Snippet: Extract Domain Expiry via RDAP
Parsing traditional WHOIS output is a headache because every registrar formats things differently. RDAP (Registration Data Access Protocol) solves this by returning clean, standardized JSON. This Python script (check_domain.py) queries the RDAP bootstrap to locate the right authoritative server and pulls out the exact expiration date (for production polling, be sure to use Python API timeout and retry handling so temporary RDAP rate limits don't set off false alarms).
import requests
import datetime
import sys
def get_domain_expiry(domain):
# Query the RDAP bootstrap for the TLD
bootstrap_url = f"https://rdap.org/domain/{domain}"
try:
response = requests.get(bootstrap_url, timeout=10)
response.raise_for_status()
data = response.json()
# Find the expiration event
for event in data.get("events", []):
if event.get("eventAction") == "expiration":
exp_date_str = event.get("eventDate")
exp_date = datetime.datetime.fromisoformat(exp_date_str.replace("Z", "+00:00"))
days_left = (exp_date - datetime.datetime.now(datetime.timezone.utc)).days
return days_left
except requests.exceptions.RequestException as e:
return f"Query failed: {e}"
return "Expiration date not found in RDAP response."
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python3 check_domain.py DOMAIN")
sys.exit(1)
target = sys.argv[1]
days = get_domain_expiry(target)
print(f"{target} domain expires in {days} days.")
if isinstance(days, int) and days < 30:
# Trigger alert webhook
passWire the Scripts to Cron and Free Alert Pipelines
Now let's put these scripts on autopilot using your local cron daemon. You can route the output to a central log or straight into a webhook (Slack, Discord, or Microsoft Teams) to get instant alerts without paying per-domain SaaS fees.
Open crontab -e and drop in your schedule. Running these checks twice a day gives you plenty of breathing room to fix a broken renewal well before you hit that 15-day alert threshold.
# Run SSL check twice daily at 08:00 and 20:00
0 8,20 * * * /opt/monitors/check_ssl.sh client-site.com > /dev/null 2>&1
# Run Domain check once a day at 09:00
0 9 * * * /usr/bin/python3 /opt/monitors/check_domain.py client-site.com > /dev/null 2>&1Post-Renewal Verification Checklist
Whenever your monitor flags an upcoming expiration and the auto-renewal kicks in, run through the rest of your stack to make sure the new cert actually took hold:
- Verify the Live Port: Fire off
check_ssl.shas soon as the ACME client reports success to confirm the live port is handing out the new date. - Check the Trust Chain: Make sure you're deploying
fullchain.pem(the certificate plus the intermediate CA), not justcert.pem. Mobile browsers are strict and will reject incomplete chains even when desktop browsers let them slide. - Restart Dependent Services: Web servers (Nginx/Apache), mail servers (Postfix/Dovecot), and database proxies (PgBouncer) all need their own reload commands to flush the old certificate out of memory.
- Validate WAF/CDN Edge: Once your origin certificate rotates, double-check that Cloudflare's "Full (Strict)" mode is negotiating the new handshake cleanly.
Diagnosing Visitor-Facing Certificate Warnings
If your external monitor shows a comfortable 180 days left on the clock, yet visitors are still getting hit with a "Not Secure" warning, look at your routing layer right away:
- Served Certificate Mismatch: Visitors are hitting an edge cache or load balancer that’s serving a default or expired certificate before ever reaching your healthy origin server. Check the certificate's serial number in your browser and match it against your origin.
- Incomplete Chain or Weak Cipher (SSL Labs): The certificate itself is valid, but the server is configured to allow outdated protocols (like TLS 1.0/1.1) or is missing an intermediate certificate. Run a strict Qualys SSL Labs scan to spot any protocol downgrade rejections.
- Trapped Worker Processes: A
systemctl reload nginxcommand will quietly fail if someone introduced a syntax error into the Nginx config since the last clean restart. The master process stays running and keeps serving the old certificate. Test your config withnginx -tand run a fullsystemctl restart nginxif your workers are stuck.
Quick answers
Frequently asked questions
Why does an auto-renewed SSL certificate still trigger browser warnings?
What usually happens is that your ACME client writes the fresh certificate to disk without reloading the web server, which leaves the old, expired certificate stuck in memory. Make sure you set up a post-renewal hook to run systemctl reload nginx or apache2, and double-check that any upstream CDN edge is serving the new cert too.
What is the maximum validity period for SSL certificates in 2026?
Under the CA/Browser Forum Baseline Requirements that kicked in on March 15, 2026, publicly trusted TLS certificates max out at a 200-day lifespan. That window is going to tighten even more soon, dropping to 100 days in March 2027, and eventually down to 47 days in March 2029.
How do you check the live SSL expiration date from the Linux command line?
Just run openssl s_client -servername example.com -connect example.com:443 and pipe it straight into openssl x509 -noout -enddate. Checking the live port through an actual TLS handshake shows you what your visitors are really seeing, which is way safer than trusting local file timestamps.
Why is RDAP better than WHOIS for monitoring domain expiry?
RDAP (Registration Data Access Protocol) gives you standardized JSON right out of the box, saving you from having to write brittle text parsers for inconsistent registrar WHOIS responses. You can simply hit the rdap.org bootstrap endpoint in Python to pull the exact expiration timestamp reliably.
How often should cron run SSL and domain expiry checks?
Set your SSL checks to run twice a day, and keep your domain registration checks on a 24-hour schedule. Since certificate lifetimes are shrinking down toward 47 days, checking twice daily makes sure you catch silent renewal failures with plenty of time to spare before hitting your 15-day alert threshold.
Why do mobile browsers reject an SSL certificate that works on desktop?
Mobile browsers are strict about seeing the complete trust chain, so they'll reject the connection if your server is configured with cert.pem instead of fullchain.pem. Desktop browsers tend to mask that missing intermediate link because they often have intermediate certificates cached from older sessions.
How do you fix a Cloudflare 526 error after an origin certificate renews?
You'll see a 526 error when Cloudflare is running in Full (Strict) mode and your origin server isn't presenting a valid, trusted certificate. Double-check that your origin web server actually reloaded after the ACME renewal ran, and confirm that the live port is serving the updated fullchain file.
Something wrong or out of date?
Tools change fast. Tell the editor what no longer works.