opyeb pemcheck

pemcheck · Verification

SAN and hostname matching — a wildcard covers exactly one label

Verification · 5 min read

The short answer

Browsers compare the hostname you connected to with the SAN (Subject Alternative Name) DNS entries in the certificate. CN (Common Name) was the older fallback and is already deprecated by the CA/Browser Forum Baseline Requirements.

Wildcard rules

A wildcard starts with *. and replaces exactly one left-most label. A different label count never matches.

SANHostResult
*.example.coma.example.commatch
*.example.coma.b.example.comno match (two labels)
*.example.comexample.comno match (empty label)
*.example.comA.EXAMPLE.COMmatch (case-insensitive)
app.example.comapp.example.commatch
*.example.comapp.example.cono match

A wildcard cannot cover a whole top-level domain (*) or sit in the middle (a.*.example.com). Public CAs do not issue such certificates and browsers reject them.

IP addresses need an IP SAN

When you connect by IP, the check uses the iPAddress entry, not a DNS entry. IPv4 is stored as 4 bytes and IPv6 as 16. Writing an IP into a DNS name does not make it valid for IP connections.

Certificates without SAN

Very old certificates may carry only a CN. This tool falls back to CN only in that case and notes that modern browsers ignore CN. In practice the right fix is to reissue with a SAN.

Internationalised domains

Korean, Japanese and Chinese domain names are converted to punycode (xn--) in the SAN. Browsers compare the converted form, so use punycode when you test matching.

Common myths

The hostname check here is a SAN string comparison. A real connection also validates chain, expiry and revocation.

Questions

Can a SAN hold several domains?

Yes. One certificate can carry many DNS names and IPs. More names mean more management and a wider blast radius, so include only what you need.

Are wildcard certificates safe?

They are convenient, but one key protects every subdomain, so a leak has a wide impact. Consider separate certificates for sensitive subdomains.

How is a trailing dot handled?

Under DNS normalisation a trailing dot is the same name. This tool strips it before comparing.

Enter a domain to see which SAN entry matches and why.

Open the checker

This article follows RFC 5280 and the CA/Browser Forum Baseline Requirements.