How to fix ERR_CERT_COMMON_NAME_INVALID (SSL certificate name mismatch)
This error means the SSL certificate your server shows does not list the exact web address the visitor typed. The fix is to get a certificate that covers that name (for example both example.com and www.example.com) and install it on the server that actually answers for your domain.
Your site loads fine for you one day, and the next a visitor sends a screenshot of a red warning page. Chrome and Edge call it ERR_CERT_COMMON_NAME_INVALID. It is a certificate name mismatch, and it is usually fixable in under an hour once you know which name is missing.
What the error means and what people see
An SSL certificate is issued for specific names, such as example.com and www.example.com. When a browser connects, it checks that the name in the address bar is on the certificate. If it is not, the browser stops the visit and shows a full page warning.
The wording depends on the browser:
- Chrome and Edge: "Your connection is not private" with
ERR_CERT_COMMON_NAME_INVALID. - Firefox: "Warning: Potential Security Risk Ahead" with
SSL_ERROR_BAD_CERT_DOMAIN. - Safari: "This Connection Is Not Private" or "Safari can't verify the identity of the website".
The name "common name" is a little old fashioned. Modern browsers actually check the Subject Alternative Name (SAN) list on the certificate. The result is the same: the name you visited is not on it.
Why it matters
Most visitors will not click through a red warning. They leave, and they may not come back. Customers who see it on a shop or booking page often assume the site has been hacked. Search engines also prefer working HTTPS pages, and a page that cannot be opened securely is hard for them to treat as a good result. Forms, logins and payments on the affected address are not protected until the name is right.
Common causes
- The certificate covers
example.combut notwww.example.com, or the other way round. - A wildcard certificate such as
*.example.comcovers one level only. It matchesshop.example.combut notexample.comitself, and nota.shop.example.com. - A new subdomain (like
blog.example.com) was created but never added to the certificate. - The domain points to the wrong server, and that server shows its own default certificate (common on shared hosting).
- The domain was moved or renamed and the old certificate is still installed.
- A CDN or proxy is serving a certificate that does not include your name.
How to check your site for free
Start in the browser. Click the "Not secure" label or the warning, view the certificate details, and look for the Subject Alternative Name list. Compare it to the address you typed. Test every version: https://example.com, https://www.example.com, and any subdomains you use.
For a second opinion, run your domain through the free SSL Labs Server Test from Qualys. It lists the names on the certificate and tells you if they do not match.
If you are comfortable with a terminal, this prints the names on the certificate your server returns (needs OpenSSL 1.1.1 or newer):
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName
Replace example.com with your own domain. If your exact hostname is not in the output, you have found the problem. If the names look right but the browser still complains, the domain probably points to a different server than you think, so check the DNS records at your registrar or DNS host.
How to fix it in general
- Write down every address people use: with and without
www, and any subdomains. - Check where each name points in DNS (the
A,AAAAorCNAMErecords). They should lead to the server or service that holds your certificate. - Issue a new certificate that lists all of those names. Free certificates from Let's Encrypt are fine for most small sites, and many hosts offer them with one click.
- Install the new certificate on the server, then reload the web server.
- Make sure one version redirects to the other (for example
wwwto non-www). The redirect only works if the certificate is valid for the name being redirected from, so both names need to be covered.
If you use a wildcard certificate, remember to include the bare domain as well as the wildcard name when you request it.
Fixing it on common platforms
Menu names change between versions and themes, so look for the idea rather than the exact label.
- Shared hosting with cPanel: look for SSL/TLS Status or AutoSSL. Run it again after DNS points to the server. AutoSSL cannot issue a name that does not point to that account. See the cPanel guide.
- Cloudflare: check the SSL/TLS section for the encryption mode and the Edge Certificates list. Universal SSL covers the root domain and first level subdomains, but deeper subdomains need other arrangements. See the Cloudflare guide.
- WordPress: the certificate lives on the server, not in WordPress, so a plugin cannot create it. But check Settings, General, and make sure the WordPress Address and Site Address use the name your certificate covers. See the WordPress guide.
- Your own server (Nginx or Apache): check that the
server_name(Nginx) orServerNameandServerAlias(Apache) lines match the names, and that the certificate paths point to the right files. With Certbot,certbot certificatesshows what you have, and re-running it with every name listed using-d(plus--expandwhen asked) adds the missing ones. - Website builders and managed hosts: usually you add the domain in the dashboard and the host issues the certificate. If it fails, the cause is almost always DNS pointing somewhere else.
After changing DNS, allow time for it to spread. It can take from a few minutes to a few hours, depending on the old record's lifetime.
How to confirm the fix worked
- Open a private or incognito window and visit every version of your address. You should see the padlock, with no warning.
- Check the certificate details again and confirm each name is on the list.
- Re-run the SSL Labs test and the
opensslcommand above. - Try a phone on mobile data, in case your own network or browser has cached something.
If one browser still shows the warning, clear its cache for the site or restart it, then test again.
How to stop it coming back
- Keep a list of every domain and subdomain you use. Add new ones to the certificate before you launch them.
- Turn on automatic renewal, and check that it still works after server or hosting changes.
- When you move hosts or change DNS, test HTTPS on every name straight afterwards.
- Remove DNS records for subdomains you no longer use, so they do not point at servers that show the wrong certificate.
- Run a regular check. SiteMonday looks at domain and SSL health in week 10 of its yearly cycle and reports certificate problems in a ranked fix list. Fixing them is still up to you or your developer.
A name mismatch is rarely a sign of a hack. It is almost always a certificate that was set up for one set of names while the site moved on to another.
Step by step for your platform
- SSL certificate name mismatch on Cloudflare
- SSL certificate name mismatch on cPanel
- SSL certificate name mismatch on Nginx
- SSL certificate name mismatch on Apache
- SSL certificate name mismatch on GoDaddy
- SSL certificate name mismatch on Namecheap
- SSL certificate name mismatch on WordPress
Questions
Is ERR_CERT_COMMON_NAME_INVALID a virus or hack?
Almost never. It means the certificate does not include the address that was typed, usually because of a missing `www` version, a new subdomain or DNS pointing at the wrong server.
Can visitors just click Advanced and continue?
They can, but most will not, and it teaches people to ignore security warnings. You should fix the certificate instead of asking visitors to bypass it.
Why does the error only show on www and not on the main domain?
The certificate probably lists only one of the two names. Reissue it with both `example.com` and `www.example.com`, or redirect properly after both are covered.
Does a wildcard certificate cover the main domain?
Not by default. `*.example.com` covers names like `shop.example.com`, but the bare `example.com` has to be added to the certificate as well.
How long does it take to fix?
Issuing and installing a certificate often takes minutes. If DNS had to change, wait for it to spread, which can take from a few minutes to a few hours.
Is this the same as an expired certificate error?
No. An expired certificate gives a different error (usually ERR_CERT_DATE_INVALID). A name mismatch means the certificate is valid in time but was issued for different names.