Home / Fix guides / Website security

How to fix ERR_CERT_COMMON_NAME_INVALID

This error means the web address your visitor typed is not on the site's SSL certificate. Fix it by installing a certificate that lists every name you use, or by pointing the name at the server that already has the right one.

ERR_CERT_COMMON_NAME_INVALID is the code Chrome and Edge show when the name in the address bar does not match the names on the site's SSL certificate. Visitors get a full page warning that says their connection is not private, and many of them leave. The cause is usually simple: the certificate was issued for one version of your domain, and people are visiting another.

What the error means

An SSL certificate lists the domain names it is valid for. When a browser connects to https://www.example.com, it checks that www.example.com is on that list. If it is not, the browser stops and shows the warning. The list is stored in a field called Subject Alternative Name (SAN). Certificates can also have a Common Name field, which is where the error gets its name, but current browsers rely on the SAN list.

Other browsers word it differently. Firefox shows SSL_ERROR_BAD_CERT_DOMAIN, and Safari shows its own warning about the certificate. It is the same problem.

Common causes:

  • The certificate covers example.com but not www.example.com, or the other way round.
  • A wildcard certificate such as *.example.com is expected to cover the bare domain. A wildcard covers one level only: it matches shop.example.com but not example.com or a.shop.example.com.
  • The domain points to a server that holds a different site's certificate. This is common on shared hosting and after a move.
  • A new domain or subdomain was added but the certificate was never reissued.
  • The site was renamed and the old certificate is still installed.
  • Someone opens the site by IP address, which a normal certificate does not cover.
  • A CDN or proxy is serving its own default certificate because the domain was never fully set up there.

Why it matters

Visitors see a red warning page and have to click through several steps to continue, so many will not. You lose enquiries and sales, and the site looks untrustworthy. Links in emails, ads and social posts that use the broken name lead to that warning. Search engines may also have trouble loading the HTTPS version of your pages. And the point of a certificate is to prove the visitor is talking to the real site, so a mismatch removes that protection.

How to check your site for free

Test every version of your address, not just the one you normally use: example.com, www.example.com and any subdomains such as shop.example.com.

  • In Chrome, click Not secure or the warning icon in the address bar and open the certificate details (the wording varies by version). Look at the Subject Alternative Name list and compare it to the exact address you typed.
  • Run the free SSL Server Test from Qualys SSL Labs. It reports which names the certificate covers and flags a mismatch.
  • If you have a terminal with OpenSSL 1.1.1 or newer, this prints the names on the certificate:
openssl s_client -connect www.example.com:443 -servername www.example.com </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName

If the name you tested is missing from the output, you have found the problem. If the names listed belong to a completely different company or your hosting provider, the domain is probably pointing at the wrong server.

How to fix it

  1. List every name people use. Usually the bare domain, www, and any subdomains for a shop, booking system or blog.
  2. Check DNS. Look at the A or CNAME records for each name and make sure they point to the server, host or CDN that is meant to serve the site. A name pointing at an old or shared server will show that server's certificate.
  3. Get a certificate that covers all the names. Most hosts include free certificates (often from Let's Encrypt) and can reissue them for you. With Certbot you list each name:
sudo certbot --nginx -d example.com -d www.example.com
  1. Install it and reload the web server. Hosting panels usually do this automatically. On your own server you reload Nginx or Apache.
  2. Pick one main address and redirect the others to it, so visitors always land on a name the certificate covers. See HTTP not redirecting to HTTPS for the redirect side.

Fixes on common platforms

  • cPanel and shared hosting: open SSL/TLS Status and run AutoSSL, then check the domain and its www version are both included. AutoSSL only works when the domain's DNS points at that server.
  • WordPress: the certificate comes from your host, not from WordPress. Fix it in the host's SSL area, then check Settings, General so the WordPress and Site Address use a name the certificate covers.
  • Cloudflare: look under SSL/TLS, Edge Certificates. Universal SSL normally covers the domain and its first level subdomains, while deeper ones such as a.b.example.com usually need a different certificate type. Also check the DNS record is proxied if you expect Cloudflare's certificate to be served. Our Cloudflare guide has the steps.
  • Nginx: make sure server_name lists every name, and that the ssl_certificate file for that block covers them. A missing server_name match sends visitors to the default server and its certificate. See the Nginx guide.
  • Apache: check ServerName and ServerAlias in the HTTPS virtual host, and the SSLCertificateFile it points to.
  • Managed platforms (GoDaddy, AWS and similar): the certificate has to be attached to the right service, such as a load balancer or CDN distribution, and the domain must be added as one of its names. Menu names differ, so check your provider's help pages.

Confirm the fix worked

Open a private window, which avoids cached warnings, and visit each version of your address. You should see the padlock with no warning. Then re-run the SSL Labs test and confirm every name you listed appears on the certificate. If one name still fails, DNS changes can take a while to spread, so wait and test again before changing anything else.

Stop it coming back

  • Turn on automatic renewal and check that it covers all names, not just the main one.
  • When you add a subdomain or a new domain, add it to the certificate in the same task.
  • After any move of hosting, DNS or CDN, test every name again the same day.
  • Keep a short list of every name your site uses and which certificate covers it.

SiteMonday's week 10 service checks domain, SSL and email deliverability and lists certificate problems in a ranked fix list. Making the change is up to you or your developer.

Step by step for your platform

Questions

Is ERR_CERT_COMMON_NAME_INVALID dangerous for visitors?

It means the browser cannot confirm the site is who it claims to be, so it is right to warn. On your own site it is usually a setup mistake rather than an attack, but visitors cannot tell the difference, so it should be fixed quickly.

Why does my site work without www but not with it?

Your certificate most likely lists only one of the two names. Reissue it so both `example.com` and `www.example.com` are included.

Does a wildcard certificate cover the main domain?

Not by itself. A wildcard like `*.example.com` covers one level of subdomain, and many providers add the bare `example.com` as a separate name. Check the Subject Alternative Name list to be sure.

Can I just click Advanced and continue?

You can as a visitor, but it is not a fix, and your customers will not do it. The certificate needs to be corrected on the server.

Will a new certificate fix it if DNS is wrong?

No. If the domain points to a server that holds a different certificate, you need to fix the DNS record or add the domain to the correct server first.

How long does the fix take?

Reissuing a certificate through a host is often a matter of minutes. If DNS has to change, allow extra time for the change to spread.

Related problems