What it means
Clients check that the hostname they connected to is in the certificate's SAN list (the Common Name is ignored by modern clients). Behind a shared IP, the server may also be sending the wrong certificate because of SNI.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The certificate doesn't list that name
Check:
openssl s_client -connect host:443 -servername host </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName
Fix: Reissue the certificate with every hostname as a SAN (or a wildcard that covers it).
2. The server returns the default certificate because the client sent no SNI, or the vhost is wrong
Check:
compare the output with and without -servername
Fix: Configure the certificate on the right virtual host, and use clients that send SNI.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
- Which Hostnames Does This Certificate Cover?hard 14 min
- The Right Certificate Behind a Shared IPmedium 11 min
- Create a Certificate Signing Requesteasy 5 min
No account needed for your first tries.
Related errors
- x509: certificate signed by unknown authority
The client can't build a chain from the server's certificate to a CA it trusts.