Skip to content
Y
YAS.SH
Security

TLS Certificate Health: Expiry, SANs, HSTS & OCSP

The 8 checks every TLS deployment should pass — expiry runway, SAN coverage, chain depth, protocol, cipher, OCSP stapling and HSTS — with a tool that runs them all.

yas-team7 min readtlscertificatehttps
TLS Certificate Health: Expiry, SANs, HSTS & OCSP
Featured imageTLS Certificate Health: Expiry, SANs, HSTS & OCSP

TLS is the boring plumbing that makes everything else safe, and like all boring plumbing, it fails at 3 AM on a holiday. The failures are predictable: a certificate that expired because the renewal cron broke, a SAN list that forgot the www variant, an HSTS header that was never turned on.

The TLS Analyzer runs eight checks against any host. Here's what each one means and what "healthy" looks like.

1. Expiry runway

A certificate that expires is a hard outage: every modern client refuses to connect. "Healthy" is not "not expired yet" — it's enough runway that renewal automation can fail twice and still recover.

  • 0–14 days: renewal broke. Fix it today.
  • 15–30 days: warning zone for 90-day certificates.
  • 30+ days: healthy.

The tool reports expiresInDays computed from the certificate's valid_to — no parsing required.

2. SAN coverage

Browsers match hostnames against the certificate's Subject Alternative Names (SANs), not the Common Name (CN) — the CN has been ignored by browsers for years. The classic failure: the certificate covers yourdomain.com but users type www.yourdomain.com.

Healthy: every hostname you serve is in the SAN list — apex, www, api., m., any custom domains you use for short links.

3. Chain completeness and trust

The analyzer reports whether the chain is authorized by the system trust store, plus the chain depth. A certificate that's authorized but chains through an extra, unexpected intermediate is a sign of misconfiguration. authorized: false with an error message is the "browsers will show a warning" state — debug it before customers do.

4. Protocol version

TLS 1.2 is the floor; TLS 1.3 is the goal. Anything below 1.2 (hello, TLS 1.0) should be an immediate ticket — every major browser has dropped it, and it's trivially vulnerable to BEAST-style attacks.

5. Cipher suite

The analyzer shows the negotiated cipher. For TLS 1.3 that's always an AEAD suite like TLS_AES_256_GCM_SHA384. On TLS 1.2, reject anything that isn't ECDHE-based with GCM — no CBC, no RC4, no export ciphers.

6. OCSP stapling

Stapling means the server presents revocation proof during the handshake, so clients don't need a separate connection to the CA. It's faster, more private, and under TLS 1.3 it's effectively the only revocation mechanism browsers use (CRLs and non-stapled OCSP are dead weight). The tool reports ocspStapled: true/false — false is a configuration gap, not a showstopper, but it's cheap to fix on nginx (ssl_stapling on;).

7. HSTS

The Strict-Transport-Security header tells browsers "always use HTTPS for this domain for N seconds":

Strict-Transport-Security: max-age=63072000; includeSubDomains; preload

Healthy values: max-age at least 6 months (31536000), includeSubDomains for domains where subdomains are all-HTTPS, and preload only if you've actually submitted to the preload list — publishing preload without submitting is a lie browsers will ignore.

8. Authorization error surface

Finally, the analyzer exposes the raw authorizationError when a chain doesn't verify. "self-signed", "unable to get local issuer certificate", "certificate has expired" — each points at a different fix, and the error text is usually enough to know which.

The curl one-liner for header inspection

The tool covers handshake-level facts. For header-level facts (HSTS values, security headers), a plain curl -I is still the fastest tool:

curl -sI https://yourdomain.com | grep -i "strict-transport-security"

Putting it on the calendar

TLS health is a quarterly chore that takes one POST:

curl -X POST https://yas.sh/api/v1/tools/tls-analyzer -d '{"domain":"yourdomain.com"}'

Alert on three things: expiresInDays under 30, authorized: false, and protocol below TLS 1.2. Everything else is polish. Certificates, like backups, only matter when they fail — and unlike backups, they fail on a schedule you can predict.

Frequently asked questions

How much expiry runway is safe?

At least 30 days is the floor for automated renewal; 90 days is comfortable. With Let's Encrypt-style 90-day certificates, monitor expiry in days, not months — automation gaps show up fast.

What's OCSP stapling and why does it matter?

Stapling lets the server prove certificate revocation status itself, so browsers don't have to contact the CA. It's faster and more private. TLS 1.3 makes it effectively required for revocation checks.

Does HSTS need to be set at the server or in DNS?

The HSTS header comes from your web server. The HSTS preload list is a submission-based registry that makes the header unnecessary for browsers that honor it — you can submit your domain to hstspreload.org.

Was this helpful? Share
🍪 Cookies & privacy. yas.sh uses only essential cookies to keep you signed in and remember your preferences. We do not run third-party trackers. See our cookie policy and privacy policy.
Settings