RFC 6125: Representation and Verification of Domain-Based Application Service Identity within Internet PKI Using X.509 (PKIX) Certificates in the Context of TLS

2026-08-31

RFC: RFC 6125

Published: 2011

Authors: P. Saint-Andre, J. Hodges

For nearly two decades, the rule "check that the certificate matches the hostname" was folklore. Every protocol — HTTPS, SMTP over TLS, IMAP, XMPP, LDAP — reinvented the wheel, and each one did it slightly differently. RFC 6125 finally wrote down, in one place, what "matches" actually means. It is the reason your TLS library rejects *.example.com for foo.bar.example.com, and why CN= is quietly being retired.

The problem it solves. RFC 2818 (HTTPS) gave rough guidance for browsers in 2000. RFC 2830 said something else for LDAP. RFC 3207 for SMTP was vague. XMPP had its own rules involving id-on-xmppAddr. Implementers had to synthesize half a dozen specs — and got it wrong. Notorious bugs like the null-byte CN attack (Moxie Marlinspike, 2009), where a cert for www.paypal.com\0.evil.com matched www.paypal.com in naive C string comparisons, showed the cost of ambiguity. RFC 6125 tries to unify the rules and close these holes.

Key design decisions.

Why it matters today. Every TLS-enabled protocol now cites RFC 6125 by reference instead of writing its own matching logic. When Let's Encrypt issues you a cert, the SAN list follows these rules. When Go's crypto/tls, Python's ssl module, or OpenSSL 1.1.0+'s X509_check_host() validate a hostname, they implement 6125. It also underpins later specs like RFC 7525 (TLS BCP) and RFC 9525 (which replaces 6125 in 2023, tightening wildcards further and formally killing CN fallback).

Quirky history. The document was chaired through IETF by Peter Saint-Andre, who had spent years dealing with XMPP's identity mess. It took over two years of debate — largely about wildcards. Should *.example.com match example.com? (No.) Should * alone ever be valid? (No.) What about internationalized domain names? (Compare A-labels, never U-labels.) The wildcard section alone is nearly a third of the RFC — because that's where every deployed implementation had disagreed.

Why it matters: RFC 6125 is the single source of truth for how TLS clients decide whether a certificate belongs to the server they meant to reach — the quiet spec behind every green padlock.

All newsletters