A browser warning says the certificate is not valid for the name you typed. A monitoring alert says something expires in nine days. A colleague sends a .crt file and asks whether it is the right one to install. In each case the answer is inside the certificate itself, but the raw file is a block of Base64 text that tells you nothing at a glance.
This guide walks through the fields of an X.509 certificate that actually matter when you troubleshoot, shows how to decode one in the browser or with OpenSSL and Node.js, and explains how certificate chains fit together and why their order causes so many errors.
What is inside a certificate
A TLS certificate binds a public key to one or more names, and a certificate authority (CA) signs that binding. The PEM file you usually handle is just Base64-encoded DER data between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. Decoded, the useful fields are:
| Field | What to check |
|---|---|
| Subject | Who the certificate was issued to; for websites mainly the Common Name (CN) |
| Subject Alternative Names (SANs) | The hostnames the certificate is actually valid for |
| Issuer | The CA (usually an intermediate) that signed it |
| Valid from / Valid until | The window in which clients accept it |
| Public key | Algorithm and size, such as RSA 2048 or ECDSA P-256 |
| Signature algorithm | How the issuer signed it, such as SHA-256 with RSA |
| Basic constraints | Whether it is a CA certificate or an end-entity (leaf) certificate |
| Key usage / Extended key usage | What the key may be used for, such as TLS server authentication |
| Fingerprints | Hashes of the whole certificate, used to identify it exactly |
SANs matter more than the Common Name
Modern browsers ignore the CN for hostname matching and look only at the SAN list. A certificate with CN example.com but a SAN list containing only www.example.com will fail for https://example.com. Wildcards cover one label only: *.example.com matches shop.example.com but not example.com or eu.shop.example.com.
Fingerprints are identifiers, not security settings
The SHA-256 fingerprint is a hash of the entire certificate. It changes whenever the certificate is renewed, even with the same key, so it is ideal for confirming "is this exactly the file I expect?" An SPKI pin, by contrast, is a hash of the public key only and survives renewals that reuse the key.
How certificate chains work
Your server's certificate (the leaf) is signed by an intermediate CA, which is signed by a root CA that browsers and operating systems already trust. The server must send the leaf plus any intermediates; the client supplies the root from its own trust store.
The expected order in a chain file is:
- Leaf certificate (your domain)
- The intermediate that issued the leaf
- Any higher intermediate, up to but usually not including the root
When the order is wrong or an intermediate is missing, desktop browsers sometimes cope because they cache intermediates or fetch them, while command-line tools, mobile apps and API clients fail with errors like "unable to get local issuer certificate". That inconsistency is why chain problems often surface only for some users.
Decode a certificate with our tool
The SSL Certificate Decoder parses certificates in your browser with a built-in ASN.1 parser. Certificates are public, but nothing is uploaded anyway.
- Paste the PEM text into PEM certificate or chain, or click Open file to load a
.pem,.crt,.ceror.derfile. Click Sample if you just want to explore. - Read the status badge on each certificate card. It shows days left, "Not yet valid" or how many days ago it expired.
- Check Subject Alt Names against every hostname you serve, including the bare domain and
www. - Look at Basic constraints to see whether each certificate is an end-entity (leaf), intermediate CA or root CA.
- If you pasted several certificates, read the Chain order panel. It reports whether the order is correct, suggests a better order if not, and verifies each signature link.
- Copy the SHA-256 fingerprint or SPKI SHA-256 pin (Base64) with the copy icons when you need to compare values with a CA portal or monitoring system.
The decoder does not fetch certificates from live sites and does not check revocation, so use the command-line methods below for those.
Other ways to read a certificate
OpenSSL
OpenSSL prints every field, and can also pull the chain from a live server:
# Full human-readable dump
openssl x509 -in example.crt -noout -text
# Just the fields you usually need
openssl x509 -in example.crt -noout -subject -issuer -dates -ext subjectAltName -fingerprint -sha256
# Exit code 1 if the certificate expires within 30 days (2,592,000 seconds)
openssl x509 -in example.crt -noout -checkend 2592000
# Show the chain a server actually sends
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
The -servername flag matters on shared hosting: without it you may get the default certificate rather than the one for your domain.
Node.js
Node has a built-in X509Certificate class, which is handy for scripts that check expiry across many files:
const { X509Certificate } = require("node:crypto");
const fs = require("node:fs");
const cert = new X509Certificate(fs.readFileSync("example.crt"));
console.log("Subject: ", cert.subject);
console.log("SANs: ", cert.subjectAltName);
console.log("Valid to: ", cert.validTo);
console.log("SHA-256 FP:", cert.fingerprint256);
const days = Math.floor((new Date(cert.validTo) - Date.now()) / 86400000);
console.log("Days left: ", days);
Browsers and operating systems
Clicking the padlock or site information icon in the address bar leads to a certificate viewer in every major browser. On Windows, double-clicking a .crt file opens the built-in certificate dialog; on macOS, Keychain Access can display it. These are fine for a quick look, but the chain view shows what the browser built, which may differ from what your server actually sends.
Troubleshooting common certificate problems
"Certificate is not valid for this name"
The hostname is missing from the SAN list. Reissue the certificate with every name you need. When you order it, confirm the request includes all names with a CSR Decoder before submitting.
Works in a browser, fails in curl or an app
Almost always a missing or misordered intermediate. Rebuild the chain file as leaf first, then intermediates, and reload the server. Paste the result into the decoder to confirm the chain order is reported as correct.
The new certificate is not being served
Compare the SHA-256 fingerprint of the file you installed with the one returned by openssl s_client. If they differ, the server is still using an old file, another virtual host is answering, or a load balancer or CDN terminates TLS in front of it.
Private key mismatch after renewal
The server refuses to start or reports a key mismatch. Compare the public key hashes of the certificate and private key; if you are generating a new key pair, the RSA Key Pair Generator explains the formats involved.
Frequently asked questions
Is it safe to share or paste a certificate?
Yes. A certificate contains only public information: names, a public key and a signature. Never share the private key file, which usually starts with BEGIN PRIVATE KEY.
Why does my certificate show two fingerprints?
Tools often show SHA-256 and SHA-1 fingerprints side by side. Use SHA-256 for comparisons; SHA-1 is shown mainly for older systems that still display it.
Should the root certificate be in my chain file?
Usually not. Clients already have trusted roots, and sending the root adds bytes without helping validation. Include the leaf and all intermediates.
How can I tell a leaf from an intermediate certificate?
Check basic constraints. A leaf has CA set to false or omits the extension, while an intermediate or root has CA set to true. A root is also self-signed, meaning its subject and issuer are the same.
What do the PEM and DER formats mean?
DER is the binary encoding of the certificate. PEM is the same data in Base64 with header and footer lines, which is easier to paste; you can inspect the Base64 part with a Base64 converter but a certificate decoder is far more readable.