Skip to content
SSL and certificates3 min read

NET::ERR_CERT_COMMON_NAME_INVALID: the certificate doesn't match the site name

NET::ERR_CERT_COMMON_NAME_INVALID

Short answer

NET::ERR_CERT_COMMON_NAME_INVALID means the SSL certificate the server presented was issued for a different name than the one you opened, for example a certificate for example.com when you visit www.example.com or a subdomain. The fix is a certificate covering every name you use, and making sure the domain points to the right server.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Common causes
  2. How to fix it
  3. Prevention
  4. On ArabyHost

This code usually appears inside the “Your connection is not private” page. Every SSL certificate carries a list of the names it covers, in a field called Subject Alternative Name (SAN). When connecting, the browser compares the name in the address bar with that list; if it isn’t there, the browser refuses the connection even when the certificate is valid and from a trusted authority.

Common causes

  • The certificate doesn’t include www or the subdomain you opened, such as shop.example.com.
  • A new subdomain that hasn’t had a certificate issued yet.
  • The domain points to a server that doesn’t know the site, so it presents its generic hostname certificate.
  • Opening the site by IP address, like https://203.0.113.10, when the certificate is for the domain.
  • Wildcard limits: *.example.com covers neither example.com nor a.b.example.com.
  • A public network or antivirus intercepting the connection, as hotel and airport Wi-Fi does before you sign in.

How to fix it

If you’re a visitor

  1. Check the URL, and try the domain with and without www.
  2. On public Wi-Fi, open the network’s sign-in page first, then reopen the site.
  3. Try another network, and temporarily disable HTTPS scanning in your antivirus.
  4. Don’t bypass the warning on login or payment pages.

If you own the site

  1. See which names the certificate covers:

    echo | openssl s_client -connect example.com:443 -servername www.example.com 2>/dev/null \
      | openssl x509 -noout -subject -ext subjectAltName

    If the name your visitors use isn’t in the DNS: list, that’s the cause. If you see the server’s hostname instead of your domain, the domain points to the wrong server or isn’t added to the account.

  2. Make sure every name has a DNS record: www needs a CNAME to the main domain or an A record. Check it with the DNS lookup tool.

  3. Make sure the domain or subdomain is added to the account in cPanel » Domains » Domains. To set a subdomain up properly, see creating a subdomain.

  4. Reissue the certificate: in cPanel open Security » SSL/TLS Status, check that every name is selected (domain, www, subdomains), then click Run AutoSSL.

  5. Redirect only after the certificate is right: a www to root redirect works only once the certificate covers both names, because the browser checks the certificate before reading the redirect.

  6. With Cloudflare: the free certificate covers the domain and first-level subdomains only; deeper names need an additional Cloudflare certificate or a different name.

Prevention

  • When adding a subdomain, create its DNS record and wait for the certificate before publishing the link.
  • Decide on your final URL form and confirm the certificate covers both variants.
  • Never publish links that use a bare IP address.

On ArabyHost

AutoSSL certificates are issued free and automatically for every domain and subdomain in your account as soon as it points to the server, so usually you only need to confirm the DNS records for each name and click Run AutoSSL in cPanel, one click from the Araby Panel. If you see the server’s hostname certificate instead of yours, the domain probably isn’t added to the account or points somewhere else. The Araby AI assistant reads the logs and explains why a certificate wasn’t issued for a particular name.

FAQ

Why does the site work without www but error with www?

The certificate doesn't include www, usually because www had no DNS record when the certificate was issued. Add the www record and run AutoSSL again.

Can I just redirect www to the main domain?

No. The browser checks the certificate before it ever sees a redirect, so if the certificate doesn't cover www the error appears first. The certificate must cover both names.

Does a wildcard certificate cover the root domain?

A *.example.com certificate covers one level of subdomains only. It doesn't cover example.com itself unless that name is added explicitly, and it doesn't cover a.b.example.com.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.