Skip to main content

Common problems

Certificate name does not match the hostname

ERR_CERT_COMMON_NAME_INVALID means the certificate is valid, just not for the name you asked for. Five reasons that happens and how to read the SAN list.

On this page

The padlock is broken and the error says the certificate name is invalid. Nothing is expired, the issuer is trusted, and the certificate works perfectly on another hostname.

That is the whole problem: the certificate is valid, it just does not cover the name in the address bar. Browsers match the requested hostname against the certificate’s subject alternative name list, and yours is not in it.

Read the SAN list first

Before theorizing, look at what the certificate actually claims to cover:

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName

Compare that list against the name you typed, character for character. The answer is usually visible immediately.

The five reasons

CauseWhat it looks like
The bare domain is missing*.example.com is on the certificate, example.com is not. www works, the apex does not
Wildcard depth*.example.com matches www.example.com but never a.b.example.com. Wildcards cover exactly one label
Default virtual hostThe server did not recognize the requested name and fell back to whatever certificate is configured first, which belongs to a different site
Missing SNIAn old client or script did not send the server name, so the server had to guess and guessed wrong
The wrong certificate is deployedA new certificate was issued for a different set of names and deployed to the wrong place

Common Name is not what is being checked

Worth clearing up, because the error message misleads. Browsers stopped using the Common Name field for hostname matching years ago and use the subject alternative name extension exclusively.

So a certificate whose CN reads example.com will still fail for example.com if that name is not also in the SAN list. The error text mentioning “common name” is a legacy label, not a description of what was checked.

The apex and wildcard trap

This one catches people repeatedly, so it is worth stating plainly.

*.example.com covers www.example.com, api.example.com, and shop.example.com. It does not cover example.com, and it does not cover dev.api.example.com.

If you want the apex and its subdomains on one certificate, both example.com and *.example.com have to be listed. Most issuers do this automatically when you ask for a wildcard, which is exactly why the ones that do not catch you by surprise.

Fix and confirm

Reissue the certificate with the complete name list, deploy it to whichever service terminates TLS for that name, and reload. Then re-run the command above against the name that was failing, plus every other name on the certificate, since adding one name is a good opportunity to drop another by accident.

If the mismatch only happens on some requests, you are probably looking at a load balancer where one node has a different certificate. Certificate expiry, revocation, and deployment covers reading the per-endpoint evidence, and connection and certificate errors covers the neighboring failure modes.

Questions people ask

What does ERR_CERT_COMMON_NAME_INVALID actually mean?

The server presented a certificate that is otherwise fine, but the hostname you requested is not in its subject alternative name list. The certificate is valid, just not for that name.

My certificate covers *.example.com but example.com itself fails. Why?

A wildcard covers one label to the left of the domain, so *.example.com matches www.example.com but not example.com itself and not a.b.example.com. The bare domain needs to be listed separately on the certificate.

Does the Common Name field still matter?

No. Browsers have ignored Common Name for hostname matching for years and use the subject alternative name extension only. A name that appears in CN but not in the SAN list will fail, despite the error message mentioning common name.

Last verified Sep 18, 2026

Try these checks on your own domain: Start a free scan. If a result needs a closer look, contact us.