Fix NET::ERR_CERT_COMMON_NAME_INVALID
www, and install it on the right virtual host.What causes it
Browsers compare the hostname you typed with the names in the certificate's Subject Alternative Name (SAN) list. If there is no match, you get this error. It does not mean the encryption is weak, only that the certificate was issued for different names.
Fix NET::ERR_CERT_COMMON_NAME_INVALID: find the mismatch
echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null \
| openssl x509 -noout -ext subjectAltNameThe Live SSL Checker shows the same names and tells you if they match. The SSL Decoder reads a certificate file.
| You see | Meaning |
|---|---|
| Only example.com listed, visit www.example.com | Add www to the certificate |
| Certificate for another site | Wrong virtual host or default site answering |
| *.example.com, visit a.b.example.com | Wildcards cover one level only |
| Hosting company name on the certificate | Site is on a shared default certificate |
| Works by name, fails by IP address | Certificates cover names, not your IP |
Fix it
- List every hostname visitors use, with and without www.
- Reissue the certificate with all of them, for example at TryFreeSSL.
- Install it on the virtual host that serves those names.
- Make sure each hostname resolves to the right server. Check records with the DNS Lookup Tool.
- Redirect alternate names to one main address.
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/ssl/example/fullchain.pem;
ssl_certificate_key /etc/ssl/example/private.key;
}
Fix NET::ERR_CERT_COMMON_NAME_INVALID behind a CDN
The visitor sees the CDN's edge certificate, so the hostname must be added in the CDN as well. For custom domains on a SaaS platform, finish the domain verification so the platform can issue its certificate. If the origin has its own certificate with strict checking, that must match too.
Prevent it
When you add a subdomain, add it to the certificate before you launch it. Use a wildcard if you launch subdomains often. After every change, run the Live SSL Checker and test both the www and non-www versions. Keep a single canonical address with one-hop redirects, which the HTTPS Redirect Generator can help produce.
Related reading: using one certificate on several domains and the wider HTTPS troubleshooting guide.
Frequently Asked Questions
Is NET::ERR_CERT_COMMON_NAME_INVALID dangerous?
It means the certificate does not match the site. Do not proceed on a site you do not own. For your own site, fix the certificate.
Does the Common Name field still matter?
Browsers rely on the SAN list. Always put every hostname there.
Why does www fail but the bare domain works?
The certificate does not list www. Reissue with both names.
Can I fix this on the browser side?
No. The certificate has to be corrected on the server.
Does the error mean the certificate is expired?
No. Expiry has its own error. This one means the name in the address bar is not on the certificate, even when the certificate is current and correctly chained.
Do I need a new certificate for www?
If www is not listed, yes, or a reissue that adds it. Many CAs issue one certificate covering both the apex and www, and browsers treat them as different names.
Why does it work on one hostname and fail on another?
The virtual host or the CDN rule is serving a different certificate. Check which certificate the server sends for that specific name with an SNI test, not just the default site.
Can a wildcard certificate cover www?
No. A wildcard such as *.example.com matches one label, so it covers shop.example.com but not example.com itself. If you serve both the apex and www, list both names on the certificate or keep a second certificate for the apex.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.