ERR_CERT_COMMON_NAME_INVALID: the certificate doesn't match the domain
Updated November 16, 2026 · 6 min read
When a certificate doesn't cover the address a visitor typed, browsers stop the page and show a full-page warning. Chrome shows "Your connection is not private" with the code NET::ERR_CERT_COMMON_NAME_INVALID. Firefox shows "Warning: Potential Security Risk Ahead" with SSL_ERROR_BAD_CERT_DOMAIN. The certificate can be valid, unexpired and from a trusted authority. It is simply for a different name.
A certificate lists the exact hostnames it covers, in a field called Subject Alternative Names. The browser compares the address in the bar with that list, and if the address isn't on it, the visitor gets the warning. Chrome stopped using the older Common Name field in 2017 (version 58), so only that list counts, even though the error code still says "common name".
1. Find out which names the certificate covers
Enter the exact address that shows the warning into the free SSL checker. It tells you the certificate isn't issued for that name, and lists the names it does cover.
From a terminal, this prints the names the certificate covers. Use the address that shows the warning in both places:
echo | openssl s_client -connect www.example.com:443 -servername www.example.com 2>/dev/null | openssl x509 -noout -text | grep -A1 "Alternative Name"Look for the exact address you tested. example.com and www.example.com are different names, and a certificate has to list each one.
2. The usual causes
- The certificate covers `example.com` but not `www.example.com`, or the other way round. The most common cause. The certificate was requested for one name and the other was forgotten.
- A wildcard that doesn't reach far enough.
*.example.comcoverswww.example.comandshop.example.com. It does not coverexample.comitself, and it does not covertest.shop.example.com, because a wildcard matches one level only. - The server is showing another site's certificate. When one server hosts several sites, it picks the certificate by the name in the request. If a new site has no certificate or no server block of its own yet, the server falls back to a default one, which belongs to a different site. This is common right after adding a domain to hosting, or moving a site to a new server.
- The domain points at the wrong place. If DNS still points at an old host, a parking page or a different service, visitors get that server's certificate. After a move, DNS can take hours to reach everyone, so some people see the warning and others don't.
- A CDN or proxy doesn't cover the name. Many CDNs cover only the domain and its first-level subdomains by default. Check what yours covers before you add a deeper subdomain.
- Visiting by IP address. Certificates are issued for names, not IP addresses, so
https://203.0.113.10shows the warning even when the site is set up correctly. Use the hostname.
3. Fix the cause
A name is missing. Reissue the certificate with every name on it. With Certbot, repeat the command you used originally, list each name with -d, and add --expand. For example:
sudo certbot --expand -d example.com -d www.example.comThen reload the web server, for example sudo systemctl reload nginx. On managed hosting or a control panel, add the missing domain or subdomain in the SSL section and run the certificate issue again (often called AutoSSL). For a certificate you bought, ask the provider to reissue it with the extra name.
The wildcard doesn't reach. Put both example.com and *.example.com on the same certificate. Name any deeper subdomain separately, or use a certificate that covers it.
The server shows the wrong certificate. Make sure the site has its own server block or virtual host for that name, with its own certificate, and that the name is in its server_name line (nginx) or ServerName line (Apache). Then reload the web server.
DNS points elsewhere. See where the name points, and change the record if it's wrong. Wait for the change to spread before testing again.
dig +short www.example.com4. Check the fix worked
Run the address through the SSL checker again and look for the name in the list it covers. Then open each version of the address in a private browsing window: with and without www, and any subdomains. A normal window can keep using the old connection for a while.
After moving a site to new hosting
This warning is common right after a move. The old certificate belonged to the old server, and the new one hasn't been issued for every name yet. Many hosts can only issue a certificate once DNS points at them, so there can be a gap between the switch and the certificate. Check every address as soon as DNS changes, not the next day.
Catch it before visitors do
Site Monitors checks every hostname you add and flags a certificate that isn't issued for it, along with expiry and broken chains. Add the www and bare versions of each domain as separate sites. It's free for up to 5 sites. You can check any address right now with the free SSL checker.