A certificate error looks the same to users in a browser, but the cause matters, because each one has a different fix. Most cases fall into one of four groups. This guide shows how to identify which one you have.
1. The certificate has expired
The simplest case and the most common in practice. Browsers show a "certificate expired" message, and command line clients fail with a verification error.
Check the validity dates:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates
The notAfter line is the expiry. Lifetimes are getting shorter: the industry is reducing the maximum validity of public certificates in stages (200 days from March 2026, then 100, then 47 days), so renewal has to be automated rather than a yearly calendar reminder. A renewal that works but is never deployed (the new certificate sits on disk while the server keeps serving the old one until a reload) is a classic way to hit this.
2. The certificate is self-signed or from an untrusted authority
The certificate is valid in itself, but nobody the client trusts vouches for it. Fine for an internal test server, not for anything public. The tell is the issuer equals the subject.
openssl x509 -noout -subject -issuer -in cert.pem
If both lines are identical it is self-signed. The fix is a certificate from a public CA (Let's Encrypt is free) or, for internal use, installing your own CA in the clients that need to trust it. The Self-Signed Certificate Generator is useful for local development.
3. The name does not match
The certificate is valid and trusted, but it was issued for different names than the one you typed. Modern clients only look at the Subject Alternative Name list; the old Common Name field is ignored.
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -ext subjectAltName
Common causes: connecting to the bare IP address, a missing www variant, a wildcard (*.example.com) that does not cover the apex or a second-level subdomain, or the server returning a default certificate because the client did not send SNI (the -servername option above is what sends it).
4. The chain is incomplete
The server must send its own certificate and every intermediate certificate. If it only sends the leaf, browsers often cope (they can fetch the missing intermediate), but many other clients cannot: curl, Java, Python libraries, mobile apps and older devices fail with "unable to get local issuer certificate". This one is infuriating because it works in your browser and fails elsewhere.
See what the server actually sends:
openssl s_client -connect example.com:443 -servername example.com -showcerts
You should see the leaf followed by one or more intermediates, each linked to the next. The fix is to configure the server with the full chain file (the leaf plus intermediates), not just the leaf.
Try it yourselfAdvanced SSL/TLS Deep ScanDeep inspection of TLS certificate chains.The Advanced SSL/TLS Deep Scan connects to a host, shows the certificate chain it presents, the validity dates, whether the name matches and the negotiated protocol, which covers all four cases in one run.
Reading a certificate you have as a file
Paste a PEM block into the PEM / X.509 Decoder to see the subject, issuer, validity, SANs, signature algorithm and fingerprints. Decoding runs in your browser, so the certificate never leaves your machine.
Does the certificate match the private key?
After a renewal, a server that fails to start with a "key values mismatch" error usually has a certificate and a key from different requests. With OpenSSL you compare the public key of each (the example is for an RSA key):
openssl x509 -noout -modulus -in cert.pem | openssl md5
openssl rsa -noout -modulus -in key.pem | openssl md5
If the two hashes differ, they do not belong together. The SSL Certificate & Key Matcher does this comparison for you, and also checks a CSR, in the browser.
Starting from a CSR
When you need a new certificate, you create the key pair and a Certificate Signing Request, and send only the CSR to the CA. The CSR Payload Generator builds both in the browser so you can see the fields before you submit.
Checklist
- Check the dates (
openssl x509 -noout -dates). Automate renewal and reload the server after it. - Issuer equal to subject means self-signed.
- Compare the name you use with the Subject Alternative Names.
- If it works in a browser but fails in
curlor an app, suspect a missing intermediate and serve the full chain. - After a renewal, confirm certificate and key match.