Wrong certificate served: client sent no SNI (IP access or old client) so the server returns its default certificate
Visiting by IP address or with a client that doesn't send SNI gets the first/default virtual host's certificate, causing a name mismatch.
certificate for the wrong domain served without SNIdefault certificate returned when accessing by IPserver returns default certificate no SNISNI not sent clientwrong certificate when connecting by IP address Meaning
SNI tells the server which hostname the client wants. Always use the hostname, set a sensible default_server/default certificate, and test with openssl s_client -connect IP:443 -servername example.com. Without -servername you see the default certificate.
Common causes
- Accessing the server by IP
- Client or library not sending SNI
- No
default_servercertificate set - Health check without SNI
- Load balancer with SNI passthrough issues
⚡ Quick fix
- Test with
-servername - Use the hostname in clients and health checks
- Configure a proper default certificate
Detailed fix by platform
Shell
- bash
openssl s_client -connect 203.0.113.10:443 -servername example.com </dev/null | openssl x509 -noout -subject openssl s_client -connect 203.0.113.10:443 </dev/null | openssl x509 -noout -subject
How to diagnose
- -servername — Used?
- Default cert — Correct?
- Client — Sends SNI?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in SSL / TLS
- HTTPSConnectionPool: Max retries exceeded (SSLError) Python requests: HTTPSConnectionPool(host='api.example.com', port=443): Max retries exceeded with url: /v1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ...')))
- DST Root CA X3 expired (old clients fail) Old clients: certificate has expired — Let's Encrypt chain uses expired DST Root CA X3 (OpenSSL 1.0.x, Android < 7.1.1)
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026