Fix SSL_ERROR_BAD_CERT_DOMAIN in Firefox
SSL_ERROR_BAD_CERT_DOMAIN when the site name is missing from the certificate. Reissue the certificate with all hostnames and install it on the matching server block.Fix SSL_ERROR_BAD_CERT_DOMAIN: what Firefox means
The certificate is valid and trusted, but it was issued for other names than the one in the address bar. This is the Firefox wording of the same problem Chrome reports as a common name error. Click Advanced on the warning page to see which names the certificate does cover.
Quick checks
| Check | How |
|---|---|
| Which names are on the certificate | Use the Live SSL Checker or Firefox's View Certificate page |
| Does DNS point to the right server | Use the DNS Lookup Tool |
| Is www covered | Test both example.com and www.example.com |
| Is the right server block answering | Request with openssl and the SNI name |
echo | openssl s_client -servername www.example.com -connect example.com:443 2>/dev/null \
| openssl x509 -noout -subject -ext subjectAltName
Fix SSL_ERROR_BAD_CERT_DOMAIN: fixes by cause
| Cause | Fix |
|---|---|
| Hostname not on certificate | Reissue with every hostname |
| Shared hosting default certificate | Install an SSL for your domain in the panel |
| New subdomain added later | Add it to the certificate or use a wildcard |
| Old DNS record pointing to another host | Update the record to your server |
| CDN edge not set up for the hostname | Add the domain in the CDN and wait for its certificate |
| Wrong certificate installed on the virtual host | Point the SSL directives to the correct files |
Apache example
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/example/certificate.crt
SSLCertificateKeyFile /etc/ssl/example/private.key
SSLCertificateChainFile /etc/ssl/example/ca_bundle.crt
</VirtualHost>If several sites share one IP, each needs its own VirtualHost with a matching ServerName so SNI selects the right certificate.
Get the new certificate
Issue a free certificate for all names at TryFreeSSL, install it, reload the server and re-run the checker. If you serve a language or country domain too, include it. Finally enforce one canonical address with a redirect from the HTTPS Redirect Generator.
Related reading: the common name mismatch error and the wider mismatch fix.
Frequently Asked Questions
Is SSL_ERROR_BAD_CERT_DOMAIN the same as ERR_CERT_COMMON_NAME_INVALID?
They describe the same kind of name mismatch in different browsers.
Should I click Accept the Risk?
Not on sites you do not control. On your own site, fix the certificate instead.
Why does it affect only some pages?
Different hostnames or subdomains may be served by different servers or certificates.
Can a wildcard certificate cause it?
Yes, if the host is two levels deep or the bare domain is not listed separately.
Is the certificate itself broken?
No. The chain and the dates can be perfectly valid. The error says the name in the address bar is not one of the names on the certificate, which is a coverage problem rather than a trust problem.
Do I need a new certificate for www?
If www is not on the certificate, yes, or a reissue that adds it. Many CAs will issue one certificate listing both the apex and www, which is the simplest fix. A wildcard certificate covers www as well if you already hold one.
Why does it fail only in Firefox?
Firefox may be connecting to a different address than the browser you tested with, or the server may send a different certificate depending on the name requested. Test the exact hostname with an SNI check.
Can I add a hostname without a new certificate?
Only by reissuing. A certificate's names are fixed when it is signed, so a name you add later needs a new certificate or a reissue that lists it, which most CAs allow during the same validity period.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.