SSLTrust

What Is SNI?

Server Name Indication (SNI) is a crucial feature for enabling secure connections, particularly when hosting multiple domains on the same IP address. By allowing one webserver to handle multiple SSL certificates, SNI provides a streamlined solution for securing a variety of websites or services without needing a separate IP address for each one. But what exactly is SNI, and how does it work within the TLS protocol?


Learning Objectives

After reading this article you will be able to:

  • Understand the meaning of SSL SNI
  • Describe how SNI works to secure a domain on a webserver
  • List of benefits to using SNI
  • Describe the limitations of using SNI

Learning Center

View more resources on cyber security, encryption and the internet.

When a web server needs to be accessible over the internet, it binds to a socket, essentially a combination of an IP address and port number. Typically, a server might host many domains or websites on a single IP address. However, without SNI, the server might struggle to serve multiple domains securely under the same port.

SNI, or Server Name Indication, is an extension to TLS (Transport Layer Security) that allows a client (such as a web browser) to specify which domain name it wants to connect to during the TLS handshake. This helps the server identify which SSL certificate to present based on the requested hostname, enabling multiple certificates to be used on the same server with just one IP address and port.

In practice, SNI makes it possible for hosting companies to provide secure connections to numerous websites without requiring a dedicated IP address for each site, reducing costs and simplifying server management.

How SNI Works in Practice

During the TLS handshake process, the client sends a "hello" message (known as the ClientHello), which includes the SNI host it wants to access. This information helps the server identify which certificate to use from among the multiple TLS certificates it may host. The server then responds with the correct certificate, allowing the connection to proceed securely.

For example, a single server might host www.example.com, blog.example.com, and shop.example.org. Using SNI, the server can provide the correct SSL certificate for each domain, enabling secure, encrypted connections without needing separate IP addresses.

Benefits of Using SNI

SNI provides several advantages, particularly for website owners, hosting providers, and those running multiple websites:

  • Secure Multiple Domains: SNI enables the use of multi-domain certificates (like SAN certificates) on one server, allowing the same certificate or different certificates to secure multiple domains or subdomains on a shared IP.
  • Fewer IP Addresses Needed: SNI allows multiple virtual domains to share a single IP address, which is particularly useful when IP addresses are limited or costly.
  • Scalable and Flexible: With SNI, you can easily add more domains to your server without requiring a unique IP address for each new site.
  • Works with Various SSL Certificates: SNI can be used with Extended Validation (EV) certificates, Organisation Validated (OV)certificates, and other SSL/TLS certificate types, offering flexible security options for different needs.

Challenges and Limitations of SNI

While SNI greatly simplifies managing SSL/TLS connections for multiple sites, it does have some limitations:

  • Compatibility Issues with Older Systems: Legacy systems like older versions of Windows XP or the default browser on some Android tablets do not support SNI. This means users on those systems may have difficulty accessing SSL websites that require SNI.
  • Visibility in the TLS Handshake: The SNI host is sent in plaintext during the handshake, potentially exposing which domain is being accessed. This can pose privacy issues, as anyone monitoring the connection could see the requested hostname. To mitigate this, Encrypted SNI (ESNI)has been developed to encrypt the SNI data. However, support for encrypted server name indication is still being adopted.
  • Single Point of Failure: If a load balancer or proxy server does not support SNI, it may prevent secure connections from being correctly established, leading to potential security gaps.

How SNI is Supported Across Web Browsers and Servers

Most modern web browsers—including Google Chrome, Firefox, Safari, and Edge—fully support SNI, enabling users to connect securely to SNI-enabled websites. Web servers like Apache, Nginx, and Microsoft IIS also support SNI, making it easier for hosting companies to implement and manage.

However, for website owners with users still on older systems, it is important to account for legacy browsers that may not support SNI, as these users might face connection issues or be served a default certificate, resulting in potential trust warnings.

ESNI and ECH: Enhancing Privacy in the TLS Handshake

As SNI exposes the requested domain in plaintext during the handshake, Encrypted SNI (ESNI) was developed to improve privacy by encrypting the SNI extension. ESNI uses the DNS record to retrieve a public key, which is then used to encrypt the SNI value in the ClientHello message. This helps to prevent observers from knowing which specific hostname is being accessed.

Building on this, Encrypted Client Hello (ECH) is being proposed to encrypt the entire handshake message, providing even better privacy by hiding the SNI and all initial communication between the client and server.

Both ESNI and ECH aim to improve privacy for internet users and enhance security by ensuring that hostnames and other identifying information are kept private during the handshake.

Conclusion: SNI as a Key Component of Web Security

Server Name Indication has revolutionised the way secure connections are managed, enabling hosting providers to secure multiple domains with fewer IP addresses and allowing for flexible, scalable SSL/TLS deployment. By making it easier to host multiple websites under a single certificate or multiple unique TLS certificates on the same server, SNI offers a streamlined, cost-effective solution for secure hosting.

As support for Encrypted SNI and ECH grows, the privacy and security of SNI-based connections are expected to improve, making it an even more robust choice for ensuring secure sessions across the web. Whether you're managing a large hosting environment, running several domains, or simply looking to understand how name-based virtual hosting works, SNI remains an essential component of modern internet security.