Skip to main content

How to Monitor SSL Certificate Expiration Before It Breaks Access

GuideWritten by oncall.fyi editorialPublication approved by Burak YApproval recorded 11 September 2026
Sources and verification
Source dates
Oldest source check: 10 September 2026.
Technical verification
Separate technical verification has not been recorded.

Publication approval and technical verification are recorded separately. Automated link checks establish reachability, not accuracy. A checked example verifies only its stated test cases, not the whole article or your production setup.

In short

Inventory certificates by service, endpoint, owner and renewal method. Monitor the certificate actually presented to clients as well as private CA and intermediate lifetimes where relevant. Set warning dates with enough time for the renewal process, route them to an accountable owner, and verify the deployed certificate after renewal. Expiry, hostname validation and trust-chain validation are separate checks with different failure causes.

Put this guide to work

Example verification · 10 September 2026: Bash syntax and OpenSSL's 30-day threshold checked with disposable one-day and 60-day certificates. This example does not prove a remote endpoint, RDP negotiation or RDS bindings.

Jump to a section

Key takeaways

  • A renewed file on disk does not prove clients see the new certificate.
  • Leaf expiry checks do not replace private CA and intermediate inventory.
  • Treat failed certificate collection as a monitoring fault, not a pass.

Build the inventory from access paths

Record service, public or private hostname, port, certificate binding, issuer, expiry, renewal method and owner. Include proxies and gateways between clients and the application. A certificate stored on an RDS server is not necessarily the one every client-facing endpoint presents.

For private PKI, inventory roots and intermediates separately with a rotation owner. Renewing a leaf certificate does not extend its issuer's lifetime or update every client trust store.

Inspect a standard HTTPS endpoint

This Bash example uses OpenSSL and GNU timeout. Replace example.com with a hostname you administer. It saves certificates to a temporary file and checks the presented leaf's remaining lifetime; it also requires the TLS connection to pass hostname and trust validation.

bash
#!/usr/bin/env bash
set -euo pipefail
cert_host=example.com
cert_file=$(mktemp)
trap 'rm -f "$cert_file"' EXIT

timeout 15 openssl s_client \
  -connect "${cert_host}:443" -servername "$cert_host" \
  -verify_hostname "$cert_host" -verify_return_error \
  -showcerts </dev/null >"$cert_file"
openssl x509 -in "$cert_file" -noout -subject -issuer -dates
openssl x509 -in "$cert_file" -noout -checkend 2592000

The final value is an illustrative 30-day warning window in seconds. OpenSSL x509 (opens in a new tab) documents -checkend; s_client (opens in a new tab) documents the connection and verification options. A nonzero result needs investigation: distinguish collection or trust failure from a successfully collected certificate nearing expiry.

For a private CA, configure the intended trust material explicitly. Do not disable verification merely to clear the monitor. This HTTPS example does not implement RDP's protocol negotiation or verify all RDS role bindings. Use service-specific administration and a real client connection for those paths.

Route warnings early enough to act

Choose warning windows from the renewal and rollout lead time. A routine early warning can create an owned task; a near-expiry condition may need escalation. Avoid sending repeated overnight pages for a certificate that already has a scheduled renewal and ample margin.

Keep failed collection visible too. A DNS error that prevents reading the certificate must not reset its status to healthy.

Verify renewal from the client side

After renewal and the required reload or binding update, reconnect through each relevant endpoint. Compare serial or fingerprint and expiry, then test hostname, chain and normal application access. Check multiple backends where a load balancer can expose inconsistent certificates.

In a test environment, exercise an approaching-expiry certificate, an untrusted chain, a wrong hostname and a connection failure. Confirm distinct findings reach the owner. Save the renewal procedure and CA dependencies in the runbook template.

Did this help?

Your answer helps us improve this guide. We save only the page and your choice for 30 days.

No name, email, or incident details are requested.

Frequently asked

Does the sample monitor an RDP listener?
No. It demonstrates a standard TLS endpoint on port 443. RDP and individual RDS roles require service-specific checks and client validation.
Why is the warning still active after renewal?
The running service may still present the old certificate, another backend may be stale, or the warning may concern a different chain certificate. Compare the actual served identity and expiry.

Sources

Vendor facts change. Each source below shows the date this page last checked it.

  1. openssl-x509 OpenSSL. Checked 10 September 2026.
  2. openssl-s_client OpenSSL. Checked 10 September 2026.

Related

One practical idea, occasionally

The On-Call Brief: short field notes, templates, and operational lessons.

Follow the field guide

Email subscriptions are not open yet. Read new guides in your feed reader — no email address needed.

Subscribe with RSS