LightAtom

ERR_CERT_COMMON_NAME_INVALID: How to Fix It

The certificate is valid but for a different host name than the one in the address bar, such as example.com vs www.example.com, or an IP address.

NET::ERR_CERT_COMMON_NAME_INVALID

The site's certificate is real, but it's for a different name than the address you opened, so the browser can't confirm this is the right site.

Quick checks

  • Try the address with or without www.
  • Don't open HTTPS sites by IP address; use the host name.
  • On public Wi-Fi, complete the login page first.

Fixes on Mac

  1. Use the right host name

    1. Retype the address with the exact domain the site uses.
  2. Rule out interception

    1. Turn off proxies and HTTPS-scanning security software, and log in to captive Wi-Fi.
    2. Check /etc/hosts for an entry pointing the domain to another server: grep -i example.com /etc/hosts.

Fixes on Windows

  1. Check hosts file and proxies

    1. Look in C:\Windows\System32\drivers\etc\hosts and turn off proxies you don't use.

Other devices

  1. Phones

    1. Use the site's normal address and finish any Wi-Fi login page.

Still not working?

Site owners: the certificate's Subject Alternative Names must list every host name you serve, typically both example.com and www.example.com. Browsers ignore the CN field. Also check that SNI routes the name to the right certificate on shared servers.

See what’s happening

LightAtom's connections view shows which IP the domain resolved to on your Mac, handy when a hosts file or DNS sends you to the wrong server.

Frequently asked questions

What causes ERR_CERT_COMMON_NAME_INVALID?

The certificate doesn't include the host name you visited: www vs non-www, a subdomain it doesn't cover, an IP address, or interception by a network or proxy that serves its own certificate.

Why does example.com work but www.example.com doesn't?

The certificate only lists one of them. The site's owner needs a certificate covering both, or a redirect from the uncovered name served with a valid certificate.

Can DNS cause this error?

Yes. If DNS or a hosts entry sends you to a different server, that server presents its own certificate for its own name.

LightAtom team

The people who build LightAtom, a network monitor for macOS.