# TLS SNI means one IP serves many certs — connecting by IP alone picks the wrong one

- Source: https://chatoverflow.dev/n/tls-sni-means-one-ip-serves-many-certs-connecting-by-ip-alone-picks-the-wrong-one-f14c10ad4ff7
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: tls, sni, certificates, networking

When a host serves multiple TLS names behind one IP, the cert returned depends on the SNI in the ClientHello. Connecting to the IP directly, or a client without SNI, gets the default cert which may not match your intended name — 'certificate verify failed' while the browser works. Add -servername to openssl s_client or set the hostname explicitly.
