Skip to content
On this page

SSL issues

Hostname doesn't match certificate ​

The SSL certificate served by your site was issued for a different domain than the one DomainDash is checking. Browsers reject this because it could be a sign of a misconfigured server or a man-in-the-middle attempt.

Symptom ​

  • DomainDash marks the SSL check as Invalid and the site shows a Security problem badge. The Security card reads "Your certificate is for a different domain, so browsers will show visitors a warning."
  • Visitors see a browser warning like "This certificate is not valid for the requested domain" or NET::ERR_CERT_COMMON_NAME_INVALID
  • Running openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -text shows a Subject and SAN that don't include your domain

What it means ​

Every SSL certificate lists the domain (or domains) it's valid for in two places: the Subject Common Name (CN) and the Subject Alternative Name (SAN) extension. Modern browsers only check the SAN. If the domain being requested isn't in the SAN list, the browser rejects the connection and shows visitors a warning. The check is deliberate: it stops one site's certificate from being used to impersonate another.

Browser warnings you might see ​

The full-page warning is generic: "Your connection is not private" (Chrome and Edge), "Warning: Potential Security Risk Ahead" (Firefox), or "This Connection Is Not Private" (Safari) shows for any certificate problem. The error code underneath points to a hostname mismatch:

WhereWhat it says
Chrome / EdgeNET::ERR_CERT_COMMON_NAME_INVALID
FirefoxSSL_ERROR_BAD_CERT_DOMAIN
Safari"…because its identity cannot be verified"
curlcurl: (60) SSL: no alternative certificate subject name matches target host name

If you see one of these, the certificate being served doesn't list the domain you're visiting. If the code instead mentions DATE_INVALID, it's a validity problem rather than a hostname one. See certificate expired or certificate not yet valid.

Common causes ​

  • You added a new subdomain (e.g. shop.example.com) but your certificate only covers the apex (example.com).
  • You're serving the same certificate for www.example.com and example.com but the certificate only includes one of them.
  • You switched from a single-domain certificate to a wildcard but the wildcard doesn't cover the requested host (e.g. *.example.com doesn't cover example.com itself).
  • The wrong virtual host is responding. Your server has multiple sites configured but the default/fallback host is serving its own certificate to requests for your domain.
  • Your CDN or reverse proxy is using a default certificate because your custom certificate hasn't been uploaded or attached to the right hostname.
  • DNS points the wrong way. The domain resolves to a server that legitimately serves a different site's certificate.

How to fix ​

  1. List the domains your certificate covers. Run:

    bash
    openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"

    You'll see a line like DNS:other.com, DNS:www.other.com. If your domain isn't in this list, the certificate doesn't cover it.

  2. Decide whether to issue a new certificate or fix DNS. If the certificate is the wrong one for this host, you need a new certificate that includes your domain. If DNS is pointing at the wrong server, fix DNS instead.

  3. For Let's Encrypt with certbot, add the missing domain to the certificate:

    bash
    sudo certbot --expand -d example.com -d www.example.com -d shop.example.com

    Then reload your web server.

  4. For hosted providers (Cloudflare, Netlify, Vercel, etc.), add the domain in the dashboard. Most providers will issue a new certificate covering all configured custom domains within a few minutes.

  5. For wildcard certificates, confirm whether you need the apex too. *.example.com does not cover example.com. You need both certificates or a multi-SAN cert.

  6. If the wrong virtual host is responding, check your web server config (nginx -T, apachectl -S) and make sure the server_name / ServerName directives match the domains you're serving certificates for.

Worked examples ​

The SAN list doesn't include your domain ​

You've added shop.example.com, but the certificate only covers the apex and www. The SAN check shows it:

bash
$ openssl s_client -connect shop.example.com:443 -servername shop.example.com </dev/null 2>/dev/null \
  | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"
            X509v3 Subject Alternative Name:
                DNS:example.com, DNS:www.example.com

shop.example.com isn't in the list, so the browser refuses it. Expand the certificate to include the new name and reload:

bash
$ sudo certbot --expand -d example.com -d www.example.com -d shop.example.com
$ sudo systemctl reload nginx

A wildcard that doesn't cover the apex ​

The subdomains work but the bare domain fails:

bash
$ openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null \
  | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"
            X509v3 Subject Alternative Name:
                DNS:*.example.com

*.example.com matches www.example.com and shop.example.com, but not example.com itself. The certificate needs the apex listed alongside the wildcard (wildcard issuance uses DNS validation):

bash
$ sudo certbot certonly --preferred-challenges dns \
    -d "*.example.com" -d example.com

How to verify ​

  1. Re-run the OpenSSL SAN check from step 1. Your domain should appear in the list.
  2. Open the site in an incognito window. The padlock should appear with no warnings.
  3. Open the site in DomainDash and open the Security page. After the next scheduled SSL check (every 6 to 24 hours, depending on your plan), the status changes from Invalid to Valid and the Security problem badge clears. If the problem had also taken the site Down, DomainDash re-checks the certificate as soon as the site recovers, so this happens within minutes. Under Certificate details, Covers shows the certificate's main name only. Use the openssl check from step 1 to see every name on the certificate.

Catch this automatically

DomainDash keeps an eye on this for you — and tells you in plain English the moment something needs your attention, before your visitors notice. Set up in under a minute, no credit card.