Certificate Management

Monitoring expiry windows, understanding lifetime limits, validating SAN lists, and checking AIA reachability.

Certificate expiry and the renewal window

Every TLS certificate has a notBefore and notAfter date. Once the current time passes notAfter, the certificate is expired and clients will reject it with a hard error -- no warning, no bypass in most automated clients. An expired certificate is one of the most common causes of production outages, and it is entirely preventable.

The expiry window check measures how much time remains before the certificate expires and flags certificates that are approaching their expiry date:

Why certificates expire unexpectedly

Automated renewal (via ACME/Let's Encrypt, cloud provider auto-renewal, or configuration management) is supposed to prevent expiry. When it fails, the cause is usually one of:

Best practices for expiry monitoring

Monitor certificate expiry across all endpoints, not just the primary domain. Load balancers, API gateways, internal services with TLS, and CDN origin certificates all have independent expiry dates. Check the actual certificate served over the network, not the file on disk -- these can diverge if the server was not reloaded after renewal.

Set alert thresholds at 30 days (warning) and 7 days (critical). For Let's Encrypt certificates (90-day lifetime, renewed at 60 days), a 30-day warning means the renewal has already failed at least once.

Certificate lifetime limits

The CA/Browser Forum, the industry body that governs certificate issuance rules, has progressively shortened the maximum allowed lifetime for publicly trusted certificates:

The certificate lifetime check verifies that the certificate's validity period (the span from notBefore to notAfter) does not exceed the current maximum of 398 days. A certificate with a longer lifetime was either issued before the rule change (and will not be renewed with such a long lifetime) or was issued by a CA that is not complying with industry standards.

Why shorter lifetimes are better

Shorter certificate lifetimes reduce the window during which a compromised key can be abused. If a private key is stolen, the damage is limited to the certificate's remaining validity period. Revocation mechanisms (CRL, OCSP) are supposed to address this, but in practice they are unreliable: browsers soft-fail on OCSP errors, and CRL checking has been mostly abandoned by browsers due to performance and privacy concerns.

Shorter lifetimes also force automation. Manual certificate management does not scale to 90-day or 45-day renewal cycles. Organizations that automate renewal early avoid the scramble when lifetime limits decrease further.

SAN quality

The Subject Alternative Name (SAN) extension lists the hostnames (and sometimes IP addresses) that a certificate is valid for. When a client connects to example.com, it checks whether example.com appears in the certificate's SAN list. If it does not, the connection fails with a hostname mismatch error.

The SAN quality check evaluates the SAN list for issues that indicate misconfiguration or security concerns:

AIA reachability

The Authority Information Access (AIA) extension in a certificate contains URLs that clients can use to fetch missing information about the certificate chain:

The AIA reachability check verifies that the CA Issuers URL in the certificate is actually reachable and returns a valid certificate. This matters because:

When AIA matters

If your server sends the complete certificate chain (leaf + all intermediates), AIA reachability is less critical -- clients do not need to fetch intermediates because they already have them. The AIA URL is a fallback.

But if your server sends only the leaf certificate (a common misconfiguration, especially after server migrations or certificate renewals), AIA becomes the only way for clients to obtain the intermediate. In this scenario:

If the AIA URL is unreachable (the CA's server is down, the URL has changed, or the certificate is very old and the URL is no longer maintained), the fallback does not work and the incomplete chain causes hard failures for all non-browser clients.

Best practice

Always configure your server to send the complete certificate chain, regardless of AIA availability. Treat AIA as a safety net, not a primary mechanism. Verify chain completeness by connecting with openssl s_client, which does not fetch AIA URLs and will show you exactly what the server sends.

# Check what the server actually sends (no AIA fetching)
openssl s_client -connect example.com:443 -showcerts 2>/dev/null | \
  grep -c "BEGIN CERTIFICATE"
# Should be 2+ (leaf + intermediates). If 1, the chain is incomplete.

Putting it together: a certificate health checklist

  1. Expiry window -- is the certificate more than 30 days from expiry? Is automated renewal working?
  2. Lifetime -- is the certificate's total validity period under 398 days? Older, longer-lived certificates should be replaced.
  3. SAN coverage -- does the SAN list cover all hostnames that resolve to this server? Are there unnecessary wildcards or excessive domains?
  4. AIA URLs -- are the CA Issuers and OCSP URLs reachable? Even if you serve the full chain, unreachable AIA is a signal that the CA's infrastructure may have issues.
  5. Chain completeness -- does the server send all intermediates, or is it relying on AIA as a crutch?
  6. Renewal automation -- is ACME or another renewal mechanism configured, tested, and monitored? Can you prove the last renewal succeeded?

Inspect certificate expiry, lifetime, and SAN quality

Checks certificate expiry window, lifetime compliance, SAN list, AIA reachability, and chain completeness.