X.509 is the standard format essentially every SSL/TLS certificate on the internet follows — originally defined in 1988 as part of a much broader directory standard, and refined over decades into the format browsers, servers, and every certificate tool speak today. Understanding its structure demystifies what's actually inside the file your server presents.
Why version 3 matters specifically
X.509 v1 (1988) and v2 were fairly minimal. X.509 v3, introduced in 1996, added the extensions field — and nearly everything modern certificates rely on lives inside extensions rather than the base fields: Subject Alternative Name (which is what browsers actually check for hostname matching today, not the old Common Name field), Key Usage (restricting what the certificate can legitimately be used for), Extended Key Usage (specifically flagging "this certificate is for TLS server authentication"), and Authority Information Access (pointing to where OCSP revocation checks or the issuing CA's certificate can be fetched).
Encoding: DER vs PEM
The X.509 structure itself is typically encoded in a binary format called DER (Distinguished Encoding Rules). What you usually see and copy-paste as a certificate file — a block of text starting with -----BEGIN CERTIFICATE----- — is PEM format, which is simply that same DER-encoded data, base64-encoded and wrapped with header/footer lines to make it safe to handle as plain text. They contain identical information; PEM is just easier to email, paste into a form, or store in a text-based config file.
Reading a certificate's raw structure yourself
openssl x509 -in yourcert.pem -text -noout
This prints every field in human-readable form — issuer, subject, validity dates, the full SAN list, public key details, and every extension present. It's the fastest way to verify exactly what a certificate contains without relying on a browser's summarized view, particularly useful when debugging why a certificate isn't matching a hostname the way you expected.
Key fields worth understanding individually
- Serial Number — unique per certificate from a given CA; used as a reference in revocation checks (OCSP, CRL).
- Signature Algorithm — the algorithm the issuing CA used to sign this certificate (e.g. SHA256withRSA); this is the CA's signature over the certificate's contents, distinct from the certificate's own public key algorithm.
- Key Usage / Extended Key Usage — restricts what the certificate is valid for. A certificate meant for TLS server authentication has this explicitly flagged; a browser will reject it for that purpose if the extension is missing or set incorrectly.
- Authority Information Access — contains URLs the client can use to check revocation status (OCSP) or fetch the issuing CA's own certificate if it wasn't already provided.
How X.509 has stayed relevant since 1988
The original 1988 standard predates the modern web entirely — it was designed as part of a broader directory service standard (X.500), for a fairly different set of use cases than securing HTTPS connections. What's kept it usable for decades since is precisely the extensions mechanism introduced in version 3: rather than requiring a new, incompatible certificate format every time a new capability was needed (like SAN entries for multiple hostnames, or key usage restrictions), new capabilities could be added as additional, optional extension fields that older software could safely ignore if it didn't understand them, while newer software could read and act on. That backward-compatible extensibility is a large part of why a format this old is still the universal standard, rather than having been replaced by something newer and more web-specific.
ASN.1: the notation underneath the format
X.509's structure is formally defined using ASN.1 (Abstract Syntax Notation One), a decades-old standard for describing structured data independent of any particular programming language, paired with DER as the specific binary encoding rule used to actually serialize it. This layered design — an abstract structure definition, plus a concrete encoding rule — is part of why X.509 has remained stable and interoperable across so many different systems and decades: any tool that correctly implements ASN.1/DER parsing can read any X.509 certificate, regardless of which CA or software originally created it.
Common parsing and format errors in the wild
- Mismatched PEM boundaries — a certificate file missing its correct
-----BEGIN CERTIFICATE-----/-----END CERTIFICATE-----markers, or with extra whitespace or line breaks introduced by copy-pasting through an email client or chat tool, will fail to parse even though the underlying data might be intact. - Wrong file for the wrong slot — pasting a CSR into a field expecting a certificate, or a private key into a field expecting a CA bundle; all three are PEM-formatted text blocks that look superficially similar at a glance, distinguished mainly by their header line.
- Certificate and bundle concatenated in the wrong order — some server software expects the certificate first followed by intermediates in a specific order within one combined file; getting that order wrong produces a chain the server can't correctly present, even though every individual certificate in the file is valid.
Reading a certificate's fields yourself, without any special tools
Any browser's certificate details view (accessible by clicking the padlock) shows every major X.509 field in human-readable form — Subject, Issuer, Validity, and Subject Alternative Name are the ones worth understanding first, since they answer the most common practical questions: who is this for, who vouches for it, and is it currently valid.
Why the format has remained stable for so long
X.509's extensibility, added in version 3, is what's let the same underlying format keep pace with decades of new requirements — SAN entries, key usage restrictions, and Certificate Transparency proofs were all added as new extensions rather than requiring an incompatible, ground-up format redesign each time a new capability was needed.
PEM versus DER: the same data, two different encodings
The structure itself is typically encoded in binary (DER), but what you usually see and copy-paste as a certificate file, text starting with -----BEGIN CERTIFICATE-----, is PEM format: that same DER data, base64-encoded and wrapped for safe handling as plain text. They contain identical information; PEM is just easier to email or paste into a config file.
Reading a certificate's raw fields with OpenSSL directly
Running openssl x509 -in yourcert.pem -text -noout prints every field in human-readable form — issuer, subject, validity dates, the full SAN list, and every extension present. It's the fastest way to verify exactly what a certificate contains without relying on a browser's summarized view.
Once you can read a certificate's raw fields directly, most certificate-related error messages stop being a black box and start pointing at a specific, identifiable field that's wrong.
A quick closing checklist for reading any unfamiliar certificate confidently
Check Subject for identity, Issuer for the vouching CA, Validity for current status, and SAN for actual coverage — four fields that answer the overwhelming majority of practical questions about any certificate you encounter.