Geonode logo
Secure connection errors

How to Fix ERR_CERT_COMMON_NAME_INVALID in Chrome

Read what Chrome's Advanced line tells you, then fix the certificate, the server or the URL.

Updated

TL;DR

ERR_CERT_COMMON_NAME_INVALID means Chrome trusts the authority behind the site's certificate, but the certificate was issued for other addresses, not the one you opened. Chrome's warning names an address it does cover; the site's owner fixes it by reissuing the certificate with every address visitors use.

What ERR_CERT_COMMON_NAME_INVALID looks like in Chrome and code

Chrome rows come from its warning page and console. In Python only the Hostname mismatch ending belongs here; other CERTIFICATE_VERIFY_FAILED endings have their own page.

WhereWhat you see
Chrome warning page (heading: Your connection is not private)Attackers might be trying to steal your information from example.org (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID
Chrome, after clicking AdvancedThis server could not prove that it is example.org; its security certificate is from www.example.org.
Chrome, after clicking Advanced, certificate without subjectAltNameThis server could not prove that it is example.org; its security certificate does not specify Subject Alternative Names.
Chrome DevTools console, failed fetch() or subresourceFailed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
curl 8.7 on macOS (LibreSSL 3.3.6)curl: (60) SSL: no alternative certificate subject name matches target host name 'example.org'
Python 3.12 ssl modulessl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'example.org'. (_ssl.c:1000)
Node.js 20 and 24 httpsError [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: example.org. is not in the cert's altnames: DNS:www.example.org

Why this happens

The site sent a trusted certificate made out to a different hostname.

Chrome matches the address only against the certificate's subjectAltName list, never its common name. Usually that list lacks one form of the domain, or the server answered with a certificate meant for another of its sites.

Diagnose your ERR_CERT_COMMON_NAME_INVALID first

The first four checks need only Chrome; the last one needs a terminal.

  • Click Advanced; if the hostname after "its security certificate is from" is the site's www or bare form, the certificate lacks your exact address.

  • If that hostname belongs to an unrelated domain, such as a hosting company's, the server that answered has no certificate set up for this site.

  • On hotel or cafe Wi-Fi, if that hostname belongs to a router or the Wi-Fi provider, the network's sign-in page answered instead of the site.

  • Check the address; if it is an IP address or a one-word name like intranet, the certificate probably lists only full domain names.

  • Run openssl s_client -connect host:443 -servername host </dev/null | openssl x509 -noout -text; if no DNS: entry covers host, this certificate lacks that name.

Solutions ranked by effectiveness

Start with the certificate's names; the later fixes cover the wrong server answering and scripts using the wrong name.

  1. Most common fix

    Put every hostname on the certificate

    Applies when Advanced shows a sibling of your address, like another subdomain of the same site. Get a replacement certificate that lists every hostname in its subjectAltName, then install it.

    1. Collect every hostname from your DNS zone, links and redirects, subdomains included.

    2. With Certbot, run certbot --nginx and add one -d flag per hostname.

    3. Reload the web server, then open each hostname again to confirm the warning is gone.

  2. Check next

    Send the name to the right server

    Applies when Advanced names an unrelated domain. A hosts-file line, a stale DNS record or a missing server block sent this address to a server without its certificate.

    1. Remove lines naming the site from C:\Windows\System32\drivers\etc\hosts or /etc/hosts.

    2. Site owners: update the DNS A record so it carries the current server's IP.

    3. On nginx, add the address to server_name in the block that loads its certificate.

  3. For developers

    Put a listed name in the URL

    Applies when a script or tool calls https:// with an IP address or a short name, which certificates rarely list.

    1. Copy a hostname from the certificate's DNS: entries into the URL.

    2. Don't count on a Host header; curl and Python still check the URL's host.

Stop the ERR_CERT_COMMON_NAME_INVALID from coming back

Habits for site owners and developers that keep each address on the certificate and pointed at the right server.

  1. Keep the bare domain on the certificate even if it only redirects; hostnames are checked before any redirect.

  2. When you renew with certbot certonly -d, list every hostname; a subset creates a separate, smaller certificate.

  3. Schedule a script that opens every listed hostname with verification on and alerts when one fails.

  4. Try a new server by IP with curl --resolve, as our Cloudflare 1003 guide shows, not a hosts-file edit.

Check your hostnames from outsideLoad each name on your certificate through residential IPs outside your own network.
Try residential proxies

Related errors

Learn more

FAQ

Chrome accepted the issuer of the site's certificate, but no hostname listed inside matches the one you requested, so it blocked the page. Reissuing the certificate with that hostname is the lasting repair.

The certificate listed only the www hostname, so Chrome tried that address and, once it loaded, switched to it by itself, noting "Redirecting navigation" in the console. curl, Python and Node.js report the error instead.

It probably has no subjectAltName, which Chrome has required since Chrome 58. curl, Node.js and Python's ssl module still fall back to the common name, but requests does not, as of urllib3 2.0.

No. *.example.net covers exactly one label, so it matches shop.example.net but neither example.net nor a.shop.example.net; list the bare domain beside the wildcard.

Reissue the development certificate with 127.0.0.1, and any LAN address you open it by, as IP entries rather than DNS names. In our Chrome test, 127.0.0.1 written as a DNS name still failed.

Through an HTTP proxy, the proxy receives the site's name and finds its address itself, so your hosts file and local DNS stop applying. If only one route fails, the two routes reach different servers.

Targeting options in one call

Geonode's API lists the countries, states, cities and ASNs each proxy service can target.