Troubleshooting guide
NET::ERR_CERT_COMMON_NAME_INVALID: how to fix it
The certificate is valid, but not for the name in the address bar. It is a mismatch between the hostname and the certificate's listed names.
3 min read10 sectionsUpdated
On this page
Common causes
example.comis covered, butwww.example.comis not, or the reverse.- A new subdomain was added after the certificate was issued.
- Wildcard limits.
*.example.comcoversapp.example.combut neitherexample.comnora.b.example.com. - The server's default site answers for an unknown name, and sends its own certificate.
- DNS pointing at a shared host or CDN that has no certificate for your domain.
Diagnose it
List the names in the certificate actually served for that hostname. -servername matters: without it, a shared server may return a different certificate.
# Names the certificate covers
openssl s_client -connect example.com:443 -servername www.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -ext subjectAltName
# Who is it for, and who issued it?
openssl s_client -connect example.com:443 -servername www.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -issuer
# Which Nginx server block is the default?
sudo nginx -T 2>/dev/null | grep -E 'server_name|default_server'Fixes
Reissue the certificate with every name you serve. With Certbot, pass each one: certbot --nginx -d example.com -d www.example.com. Add a matching server_name block for each host so the right certificate is presented. If you do not intend to serve a hostname over HTTPS, remove its DNS record. On a CDN, make sure the custom hostname is added and its certificate is active before pointing DNS at it.
Catch it automatically
Each hostname needs its own check, because the apex can be perfectly healthy while www is broken. Add SSL monitoring for all public hostnames, and include hostnames used only by redirects, since visitors from old links reach those first.
Does a certificate for example.com cover www?
Only if www.example.com is also listed. Most issuers add both when you ask, but it is not automatic.
Does a wildcard cover the root domain?
No. *.example.com does not include example.com, so list the root separately.
Why do I see another site's certificate?
The server has no matching configuration for your hostname, so it serves its default site.
Check it now, free
- SSL certificate checker: Expiry date, issuer, chain and host name match.
Related reading
- NET::ERR_CERT_DATE_INVALID: how to fix it: Fix NET::ERR_CERT_DATE_INVALID ("Your connection is not private"): an expired or not-yet-valid certificate, or a wrong device clock. Check, renew, reload.
- NET::ERR_CERT_REVOKED: how to fix it: Fix NET::ERR_CERT_REVOKED: why a certificate authority revokes certificates, how browsers learn about it, and how site owners replace a revoked certificate.
- ERR_BAD_SSL_CLIENT_AUTH_CERT: how to fix it: Fix ERR_BAD_SSL_CLIENT_AUTH_CERT: client certificates that are expired, untrusted or not selected, mutual TLS settings and corporate device certificates.
- ERR_SSL_VERSION_OR_CIPHER_MISMATCH: how to fix it: Fix ERR_SSL_VERSION_OR_CIPHER_MISMATCH: old TLS versions, weak ciphers, missing certificates for a host name and CDN SSL settings, with server configs.
- "Your connection is not private": how to fix it: Fix "Your connection is not private" (NET::ERR_CERT_*): expired or mismatched certificates, wrong device clocks, missing intermediates and Wi-Fi portals.
- ERR_BLOCKED_BY_CLIENT: how to fix it: Fix net::ERR_BLOCKED_BY_CLIENT: ad blockers and privacy extensions blocking scripts, images and API calls, and how developers avoid false blocks.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.