Opens in a new tab

NET::ERR_CERT_COMMON_NAME_INVALID: the certificate is for a different name

The certificate is valid, but not for the name in the address bar: a certificate for example.com served on www.example.com, a hosting company’s default certificate, or a shared one that does not list your domain. Browsers look only at the certificate’s Subject Alternative Names.

Your connection is not private
NET::ERR_CERT_COMMON_NAME_INVALID
How 8 other clients word the same error

Firefox

Error code: SSL_ERROR_BAD_CERT_DOMAIN — “Firefox doesn’t trust this site because its certificate isn’t valid for example.com.”

curl 8.9 and later

curl: (60) SSL: no alternative certificate subject name matches target hostname 'example.com'

curl 8.8 and earlier

curl: (60) SSL: no alternative certificate subject name matches target host name 'example.com'

curl on Windows (Schannel)

curl: (60) schannel: SNI or certificate check failed: SEC_E_WRONG_PRINCIPAL (0x80090322) - The target principal name is incorrect.

Python

certificate verify failed: Hostname mismatch, certificate is not valid for 'example.com'. (_ssl.c:1028)

Node.js

Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: example.com. is not in the cert's altnames: DNS:*.other.example

Java

No subject alternative DNS name matching example.com found.

Go

x509: certificate is valid for other.example, not example.com
ErrorNET::ERR_CERT_COMMON_NAME_INVALID
Usually fixed byThe website
FirefoxSSL_ERROR_BAD_CERT_DOMAIN
OpenSSLhostname mismatch (62)
Names that countSubject Alternative Names only — Chrome stopped reading the common name in 2017

Check the certificate a site serves

Enter the site’s domain: we connect the way a browser does and show the certificate, its chain and the TLS versions it offers.

What it means

A certificate lists the names it is valid for. If the name you connected to is not among them — www missing, a subdomain not covered, a different domain entirely — the browser cannot tell the real site from an impostor and refuses. Chrome and Apple ignore the old common name field: the name must be a Subject Alternative Name.

Chrome quietly tries the www or non-www form when that is the only difference and it works, which is one reason a site can load in Chrome but fail elsewhere.

Why it happens

  • The certificate covers example.com but not www.example.com, or the other way round.
  • A new subdomain added without a certificate that covers it — a wildcard covers one level only.
  • The server sends its default certificate because the site has none of its own, or because the client did not send the name (SNI).
  • DNS points the name at a different server or CDN than the one holding its certificate.
  • On public Wi-Fi, a sign-in page answering instead of the site.

How to fix it

  1. Check which names the served certificate covers with the check above.
  2. Issue a certificate that lists every name visitors use — the bare domain and www at least.
  3. Make sure the server’s virtual host for that name serves that certificate.
  4. Check the name’s DNS points at the server or CDN that holds the certificate.

See it for yourself

openssl s_client -connect example.com:443 -servername example.com -verify_hostname example.com </dev/null

openssl only checks the name when you pass -verify_hostname. Pipe the output into openssl x509 -noout -ext subjectAltName to list the names the certificate covers.

Sources

Error text and meaning checked on 25 September 2026 against these official sources:

Hear about it before your visitors do

Add your domain and we check its certificate on every scan and email you before it expires, and when it changes or stops being valid — along with DNS, email and security headers. Free for your first domain.

Create a free account