opyeb x509lab

x509lab · Names

SAN and host name verification

The first gate a browser applies to a certificate is a host name match. That decision is made on SAN; CN is no longer evidence.

Host checks happen on SAN

When a client opens a TLS connection, one of the subject alternative names must match the host it dialled. SAN lives in the subjectAltName (2.5.29.17) extension as a GeneralNames list, and each entry carries a type tag.

TypeASN.1 tagExample
DNS name[2] dNSNamewww.example.test, *.example.test
IP address[7] iPAddress203.0.113.10, 2001:db8::1
URI[6] uniformResourceIdentifierspiffe://example.test/service/web
email[1] rfc822Nameadmin@example.test

All four types are decoded and grouped here. URI and email SANs play no part in TLS host checks, but they matter for workload identity such as SPIFFE and for S/MIME.

The CN fallback is over

Older documentation says the common name is matched against the host. RFC 6125 restricted that, and major browsers removed the fallback. Without SAN a host check now fails. A CN that differs from SAN is a note here; a certificate with no SAN at all is a warning.

Wildcard rules

IP addresses and internationalised domains

When a client connects to an IP it compares the iPAddress entry byte by byte. A DNS entry holding "203.0.113.10" is treated as a host name and ignored for an IP connection. Internationalised domains are compared in punycode (xn--), so the SAN must carry the punycode form.

Many SAN entries make a certificate larger, and some older devices hit entry limits. Adding only the names you need is the safer habit.

Questions

Why warn about a certificate with only a CN?

RFC 6125 and later browser policy limit host checks to SAN. The CN fallback is being removed, so a CN-only certificate is rejected by some clients.

Does *.example.com cover example.com?

No. A wildcard replaces exactly one label: www.example.com matches, example.com does not.

Can an IP address go in a DNS SAN?

No. An IP address belongs in an iPAddress entry. An IP string in a DNS entry is ignored when the client connects by IP.

Add a SAN and it is decoded by type, with CN mismatches and wildcards called out.

Open the tool

This article follows RFC 5280 (X.509), RFC 6125 (host name verification), RFC 6960 (OCSP), RFC 7469 (HPKP), RFC 8555 (ACME) and the CA/Browser Forum Baseline Requirements. Every example certificate is synthetic, made for this site, and tied to no real domain.