Fix an SSL certificate that doesn't match your domain
NET::ERR_
Why the certificate doesn't match the address
The www or bare domain is missing
A certificate for www.yoursite.com doesn't cover yoursite.com, and the reverse is also true. Each name visitors use has to be on the certificate.
A wildcard one level too shallow
*.yoursite.com covers shop.yoursite.com, but not yoursite.com itself and not a deeper name like eu.shop.yoursite.com. A wildcard stands in for exactly one label.
The name reaches the wrong server
If DNS sends a name to a host or CDN that isn't set up for it, that server answers with its default certificate, which belongs to some other name.
A Wi-Fi sign-in page
Public Wi-Fi that sends you to its login page shows that page's certificate. Sign in to the network and try again before you change anything on your site.
Chromium's error list names a server sending the wrong certificate, a network login page and an attacker as causes; see net_
List the names on the certificate your server sends
# Print the names the certificate yoursite.com sends is valid for
# 1.1.1 or later: macOS ships LibreSSL as openssl, and it rejects -ext
echo | openssl s_client -connect yoursite.com:443 -servername yoursite.com 2>/dev/null \
| openssl x509 -noout -subject -ext subjectAltName
Read the names openssl prints
Browsers match the address against the DNS names under Subject Alternative Name. If the address visitors use isn't in that list, and no wildcard there covers it, the certificate doesn't cover that address. The -ext option needs OpenSSL 1.1.1 or later; OpenSSL's x509 manual explains it.
How to fix a certificate name mismatch
- Write down every name visitors useInclude the bare domain, the www version and every subdomain that serves pages, and check which of them your DNS points at your site.
- Get a certificate that covers them allAdd the missing names in your host's or CDN's domain settings, which usually issues a new certificate for them. If you manage certificates yourself, request one that lists every name.
- Point stray names at the right serverIf a name reaches a server that isn't set up for it, fix that name's DNS record or add the name to that server's configuration.
- Check each name againRun the openssl command for every name. A redirect from one name to another doesn't help here, because the browser checks the certificate before it ever sees the redirect.
Frequently asked questions
Does a wildcard certificate cover my bare domain?
No. *.yoursite.com covers names one level below yoursite.com, not yoursite.com itself, so list the bare domain on the certificate as well.
Can I redirect www to my bare domain to fix the error?
Not by itself. The browser checks the certificate before it follows any redirect, so the name you redirect from still needs a certificate that covers it.
Why does the error mention the common name?
Browsers once read a certificate's common name field to find the site it was for. RFC 9525, the current standard for matching names, uses the Subject Alternative Name list instead, so a name missing there causes the error even when the common name looks right.
Watch your certificate and HTTPS setup
- Domain healthFix the setup mistakes that make browsers warn people away from your site.
- Expired SSL certificateFind out whether the certificate expired or a clock is wrong, then renew it and serve the new one.
- Untrusted SSL certificateReplace a self-signed certificate or send the missing intermediate so browsers trust it.
- www and non-www redirectChoose www or non-www and keep redirects, canonical tags and certificates in step.