SSL ERRORS
SSL_ERROR_BAD_CERT_DOMAIN: causes and fixes
Firefox received a certificate for a different hostname. Check the address in the warning, the certificate’s SANs and the virtual host selected by SNI.
What it means
Start with the address on Firefox’s warning page, not the hostname you expected the application to use. A redirect, a missing www alias or a new DNS route can expose another TLS virtual host. The certificate’s SAN list determines which DNS identities it represents.
What to check
- Read Firefox’s advanced error details and record the requested address and covered names.
- Compare the received certificate’s fingerprint with a working client; preserve proxy and DNS differences.
- Test the same hostname with explicit SNI against the intended listener.
Test the connection
openssl s_client -connect www.example.com:443 -servername www.example.com \
-verify_hostname www.example.com -verify_return_error </dev/nullRun this OpenSSL 3.x example in a POSIX shell. Keep the hostname, peer address and full verification result with the error report.
How to fix it
- Correct unintended redirects, DNS targets or virtual-host certificate selection.
- Issue a replacement that includes every intended public alias if the current SAN list is incomplete.
- Deploy and reload it at the edge, ingress or server that terminates the failing connection.
Check the fix
Revisit the exact failing URL in Firefox and exercise the redirect path. Verify that the final hostname is covered and no alternate destination still serves a default certificate.
Details worth checking
A redirect can be the source of the mismatch. Follow the original URL through to its destination and check the certificate for each hostname.
Related guides
- Diagnose certificate hostname and SNI mismatches
- Fix SSL errors after an A, AAAA or CNAME change
- Fix HTTPS mixed content and redirect certificate failures