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.

Exact message you may see 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
Seen on: SSL OpenSSL Nginx

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_server certificate set
  • Health check without SNI
  • Load balancer with SNI passthrough issues

⚡ Quick fix

  1. Test with -servername
  2. Use the hostname in clients and health checks
  3. Configure a proper default certificate

Detailed fix by platform

Shell

  1. 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

  1. -servername — Used?
  2. Default cert — Correct?
  3. 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:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

1013 — Cloudflare Error 1013: HTTP hostname and TLS SNI hostname mismatch (Cloudflare)1013ACM region — CloudFront can't use my ACM certificate: it must be requested in us-east-1 (N. Virginia) (SSL / TLS)ACM regionAH00112: DocumentRoot does not exist — Apache: AH00112: Warning: DocumentRoot [/var/www/example.com/public_html] does not exist (Nginx / Apache)AH00112: DocumentRoot…Django — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)DjangoHAProxy backend — HAProxy: SSL handshake failure on the backend (verify required, no CA file, SNI missing) (SSL / TLS)HAProxy backendIIS SNI — IIS serves the wrong certificate: SNI not enabled on the HTTPS binding (multiple sites on one IP) (SSL / TLS)IIS SNIreset — Connection reset during the TLS handshake (SNI filtering or DPI blocking the ClientHello) (SSL / TLS)resetSNI support — Old clients fail with certificate mismatch: no SNI support (Java 6, Android 2.x, Windows XP IE) (SSL / TLS)SNI supportSNI

Explore the map of this error Full error map →

🧠 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.