Glossary

What is SNI?

SNI (Server Name Indication) is a TLS extension in which the client states the hostname it wants during the handshake, so one IP address can serve many certificates.

A TLS server must present its certificate before any HTTP request is sent, so without help it cannot know which site the client wants. With SNI, the client puts the hostname in its first handshake message and the server picks the matching certificate. This is what lets a single address host hundreds of HTTPS sites.

The hostname is sent in clear text unless Encrypted Client Hello is used, so a network observer can see which site you are contacting. SNI also explains a common debugging trap: connecting to an IP address, or running openssl s_client without -servername, can return a default certificate instead of the site’s own, and look like a mismatch.

Example

# returns the host's default certificate
$ openssl s_client -connect 203.0.113.10:443

# asks for the right site's certificate
$ openssl s_client -connect 203.0.113.10:443 -servername www.example.com