Skip to content
Surf Wiki
Save to docs
technology/networking

From Surf Wiki (app.surf) — the open knowledge base

Server Name Indication

TLS extension to serve multiple HTTPS sites


Summary

TLS extension to serve multiple HTTPS sites

Server Name Indication (SNI) is an extension to the Transport Layer Security (TLS) computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process. The extension allows a server to present one of multiple possible certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate. It is the conceptual equivalent to HTTP/1.1 name-based virtual hosting, but for HTTPS. This also allows a proxy to forward client traffic to the right server during a TLS handshake. The desired hostname is not encrypted in the original SNI extension, so an eavesdropper can see which site is being requested. The SNI extension was specified in 2003 in

Background of the problem

Prior to SNI, when making a TLS connection, the client had no way to specify which site it was trying to connect to. Hence, if one server hosts multiple sites on a single listener, the server has no way to know which certificate to use in the TLS protocol. In more detail, when making a TLS connection, the client requests a digital certificate from the web server. Once the server sends the certificate, the client examines it and compares the name it was trying to connect to with the name(s) included in the certificate. If a match occurs, the connection proceeds as normal. If a match is not found, the user may be warned of the discrepancy and the connection may abort as the mismatch may indicate an attempted man-in-the-middle attack. However, some applications allow the user to bypass the warning to proceed with the connection, with the user taking on the responsibility of trusting the certificate and, by extension, the connection.

However, it may be hard – or even impossible due to lack of a full list of all names in advance – to obtain a single certificate that covers all names a server will be responsible for. A server that is responsible for multiple hostnames is likely to need to present a different certificate for each name (or small group of names). It is possible to use subjectAltName to contain multiple domains controlled by one person in a single certificate. Such "unified communications certificates" must be reissued every time the list of domains changes.

Name-based virtual hosting allows multiple DNS hostnames to be hosted by a single server (usually a web server) on the same IP address. To achieve this, the server uses a hostname presented by the client as part of the protocol (for HTTP the name is presented in the host header). However, when using HTTPS, the TLS handshake happens before the server sees any HTTP headers. Therefore, it was not possible for the server to use the information in the HTTP host header to decide which certificate to present and as such only names covered by the same certificate could be served from the same IP address.

In practice, this meant that an HTTPS server could only serve one domain (or small group of domains) per IP address for secured and efficient browsing. Assigning a separate IP address for each site increases the cost of hosting, since requests for IP addresses must be justified to the regional Internet registry and IPv4 addresses are now exhausted. For IPv6, it increases the administrative overhead by having multiple IPs on a single machine, even though the address space is not exhausted. The result was that many websites were effectively constrained from using secure communications.

Technical principles

SNI addresses this issue by having the client send the name of the virtual domain as part of the TLS negotiation's ClientHello message. This enables the server to select the correct virtual domain early and present the browser with the certificate containing the correct name. Therefore, with clients and servers that implement SNI, a server with a single IP address can serve a group of domain names for which it is impractical to get a common certificate.

SNI was added to the IETF's Internet RFCs in June 2003 through RFC 3546, Transport Layer Security (TLS) Extensions. The latest version of the standard is RFC 6066.

Security implications

Server Name Indication payload is not encrypted, thus the hostname of the server the client tries to connect to is visible to a passive eavesdropper. This protocol weakness was exploited by security software for network filtering and monitoring and governments to implement censorship.

Presently, there are multiple technologies attempting to hide Server Name Indication:

Domain fronting

Main article: Domain fronting

Domain fronting is a technique of replacing the desired host name in SNI with another one hosted by the same server or, more frequently, network of servers known as a content delivery network. When a client uses domain fronting, it replaces the server domain in SNI (unencrypted), but leaves it in the HTTP host header (which is encrypted by TLS) so that server can serve the right content. Domain fronting violates the standard defining SNI itself, so its compatibility is limited (many services check that SNI host matches the HTTP header host and reject connections with domain-fronted SNI as invalid). While domain fronting was used in the past to avoid government censorship, its popularity dwindled because major cloud providers (Google, Amazon's AWS and CloudFront) explicitly prohibit it in their TOS and have technical restrictions against it.

Encrypted Client Hello

Encrypted Client Hello (ECH) is a TLS 1.3 protocol extension that enables encryption of the whole Client Hello message, which is sent during the early stage of TLS 1.3 negotiation. ECH encrypts the payload with a public key that the relying party (a web browser) needs to know in advance, which means ECH is most effective with large CDNs known to browser vendors in advance.

The initial 2018 version of this extension was called Encrypted SNI (ESNI) and its implementations were rolled out in an "experimental" fashion to address this risk of domain eavesdropping. In contrast to ECH, Encrypted SNI encrypted just the SNI rather than the whole Client Hello. Opt-in support for this version was incorporated into Firefox in October 2018 and required enabling DNS over HTTPS (DoH). But it was removed in January 2021 with the release of Firefox 85.

In March 2020, ESNI was reworked into the ECH extension, after analysis demonstrated that encrypting only the SNI is insufficient. For example, specifications permit the Pre-Shared Key extension to contain any data to facilitate session resumption, even transmission of a cleartext copy of exactly the same server name that is encrypted by ESNI. Also, encrypting extensions one-by-one would require an encrypted variant of every extension, each with potential privacy implications, and even that exposes the set of extensions advertised. Lastly, real-world deployment of ESNI has exposed interoperability limitations. The short name was ECHO in March 2020 and changed to ECH in May 2020.

Both ESNI and ECH are compatible only with TLS 1.3 because they rely on KeyShareEntry which was first defined in TLS 1.3.

Another Internet Draft incorporates a parameter for transmitting the ECH public keys via HTTPS and SVCB DNS record types, shortening the handshake process.

In August 2020, the Great Firewall of China started blocking ESNI traffic, while still allowing ECH traffic.

In October 2020, Russian ISP Rostelecom and its mobile operator Tele2 started blocking ESNI traffic. In September of the same year, Russian censorship ministry Roscomnadzor planned to ban a range of encryption protocols, among which were TLS 1.3 and ESNI, which hindered web site access censorship.

In July 2023, in the IETF117 meeting, members working on ECH informed Chrome and Firefox were doing a 1% sample trial, and the team expects the final draft to be submitted to the IESG evaluation by January 2024.

In Sep 2023, Cloudflare started to support ECH for hosted domains.

ECH is enabled in Firefox by default since version 119, and is recommended by Mozilla to be used along with DNS over HTTPS. In September 2023, Chromium version 117 (used in Google Chrome, Microsoft Edge, Samsung Internet, and Opera) enabled it by default, also requiring keys to be deployed in HTTPS resource records in DNS.

Implementation

In 2004, a patch for adding TLS/SNI into OpenSSL was created by the EdelKey project. In 2006, this patch was then ported to the development branch of OpenSSL, and in 2007 it was back-ported to OpenSSL 0.9.8 (first released in 0.9.8f). First web browsers with SNI support appeared in 2006 (Mozilla Firefox 2.0, Internet Explorer 7), web servers later (Apache HTTP Server in 2009, Microsoft IIS in 2012).

For an application program to implement SNI, the TLS library it uses must implement it and the application must pass the hostname to the TLS library. Further complicating matters, the TLS library may either be included in the application program or be a component of the underlying operating system. Because of this, some browsers implement SNI when running on any operating system, while others implement it only when running on certain operating systems.

Support

SNI SupportECH SupportSoftwareTypeSupportedNotesSinceSupportedNotes
Alpine (email client)IMAP email clientSince version 2.222019-02-18
Internet ExplorerWeb browserSince version 7 on Vista (not supported on XP)2006
EdgeWeb browserAll versionsSince v105 behind flag
Mozilla FirefoxWeb browserSince version 2.02006date=2022-08-24title=Developing ECH for OpenSSL (DEfO)website=defo.ielanguage=enagency=Tolerant Networks Limited.url=https://defo.ie/url-status=deviatedarchive-url=https://web.archive.org/web/20220901082756/https://defo.ie/archive-date=2022-09-01}} Enabled by default in v118 when DoH is enabled.
cURLCommand-line tool and librarySince version 7.18.12008
SafariWeb browserNot supported on Windows XPtitle=Feature: TLS Encrypted Client Hello (ECH)website=Chrome Platform Statusurl=https://chromestatus.com/feature/6196703843581952access-date=2023-07-25url-status=livearchive-url=https://web.archive.org/web/20230528035420/https://chromestatus.com/feature/6196703843581952archive-date=2023-05-28quote=Safari: No signal}}
Google ChromeWeb browser2010Since v105 behind flag.
BlackBerry 10Web browserSupported in all BB10 releases2013
BlackBerry OS
Barracuda WAFReverse ProxySupported since version 7.82013
Barracuda ADCLoad balancerFrontend support since version 4.0 and backend support from v5.2Frontend 2013 / Backend 2015
Windows MobileWeb browserSome time after 6.5
Android browser
(discontinued in Android 4.2)Web browserHoneycomb (3.x) for tablets and Ice Cream Sandwich (4.x) for phones2011
Firefox for AndroidWeb browserSupported for browsing. Sync and other services support SNI only since version 86.Only on Firefox Beta and Nightly is possible to enable DoH by a flag.
wgetCommand-line toolSince version 1.142012
Nokia Browser for SymbianWeb browser
Opera Mobile for SymbianWeb browserNot supported on Series60
DilloWeb browserSince version 3.12016
IBM HTTP ServerWeb serverSince version 9.0.0
Apache TomcatWeb serverNot supported before 8.5 (backport from 9)
Apache HTTP ServerWeb serverSince version 2.2.122009
Microsoft IISWeb serverSince version 8 (part of Windows Server 2012)2012
nginxWeb serverSince version 0.5.232007
Caddy (web server)Web server
JettyWeb serverSince version 9.3.02015
HCL DominoWeb serverSince version 11.0.12020
HCL NotesWorkflow clientSince version 14.02023
H2OWeb server
BoringSSLLibrary
BSAFE Micro Edition SuiteLibraryVersion 5.0
GnuTLSLibraryWork in progress as July 2023.
LibreSSLLibrary
Mbed TLSLibrary
Mozilla NSS client sideLibrarySince version 3.11.12006
Mozilla NSS server sideLibrary
OpenSSLLibrary
PicotlsLibrary
RustlsLibrarySupports client-side ECH; server-side ECH still todo as of August 2024
SwiftNIO SSLLibrary
wolfSSLLibrarySince v5.6.3
4th DimensionStandard libraryNot supported in 15.2 or earlier
ColdFusion / LuceeStandard libraryColdFusion since Version 10 Update 18, 11 Update 7, Lucee since Version 4.5.1.019, Version 5.0.0.502015
ErlangStandard librarySince version r172013
GoStandard librarySince version 1.42011Cloudflare/go fork provides support
JavaStandard librarySince version 1.72011
PerlStandard librarySince `Net::SSLeay` version 1.50 and `IO::Socket::SSL` version 1.562012
PHPStandard librarySince version 5.32014
PythonStandard librarySupported in 2.x from 2.7.9 and 3.x from 3.2 (in `ssl`, `urllib[2]` and `httplib` modules)2011 for Python 3.x and 2014 for Python 2.x
QtStandard librarySince version 4.82011
RubyStandard librarySince version 2.0 (in `net/http`)2011
HiawathaWeb serverSince version 8.62012Depends on Mbed TLS.
lighttpdWeb serverSince version 1.4.242009Since version 1.4.77
HAProxyLoad balancerSince version 1.5-dev122012
OpenBSD httpdWeb serverSince OpenBSD version 6.12017-04-11Depends on OpenSSL.

References

References

  1. (June 2003). "Transport Layer Security (TLS) Extensions". [[Internet Engineering Task Force.
  2. "What is a Multiple Domain (UCC) SSL Certificate?". [[GoDaddy]].
  3. "Web Filter: SNI extension feature and HTTPS blocking".
  4. "Sophos UTM: Understanding Sophos Web Filtering".
  5. (2015-05-11). "2015 IFIP/IEEE International Symposium on Integrated Network Management (IM)".
  6. "South Korea is Censoring the Internet by Snooping on SNI Traffic".
  7. (21 December 2016). "Encrypted chat app Signal circumvents government censorship".
  8. "Amazon threatens to suspend Signal's AWS account over censorship circumvention".
  9. (2023-10-09). "TLS Encrypted Client Hello". Internet Engineering Task Force.
  10. (6 April 2023). "Draft-ietf-TLS-esni-14".
  11. (24 September 2018). "ESNI: A Privacy-Protecting Upgrade to HTTPS". EFF DeepLinks Blog.
  12. (17 July 2018). "Don't panic about domain fronting, an SNI fix is getting hacked out". The Register.
  13. Ghedini, Alessandro. (2018-09-24). "Encrypt it or lose it: how encrypted SNI works".
  14. (18 October 2018). "Encrypted SNI Comes to Firefox Nightly".
  15. "Curl: Re: Support of Encrypted SNI (curl-library mailing list archive)".
  16. "1667743 - Clean up unused esni code".
  17. Jacobs, Kevin. (7 January 2021). "Encrypted Client Hello: the future of ESNI in Firefox".
  18. "ESNI -> ECHO · tlswg/draft-ietf-tls-esni".
  19. "s/ECHO/ECH · tlswg/draft-ietf-tls-esni".
  20. Ghedini, Alessandro. (2018-09-24). "Encrypt it or lose it: how encrypted SNI works".
  21. "Make ESNI TLS 1.2 compatible · Issue #38 · tlswg/draft-ietf-tls-esni".
  22. (2023-03-11). "Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)". Internet Engineering Task Force.
  23. (2023-09-26). "Bootstrapping TLS Encrypted ClientHello with DNS Service Bindings". Internet Engineering Task Force.
  24. Cimpanu, Catalin. "China is now blocking all encrypted HTTPS traffic that uses TLS 1.3 and ESNI".
  25. (11 October 2020). "Почему Ростелеком блокирует ESNI трафик?".
  26. "Russia's Digital Development Ministry wants to ban the latest encryption technologies from the RuNet".
  27. Cimpanu, Catalin. "Russia wants to ban the use of secure protocols such as TLS 1.3, DoH, DoT, ESNI".
  28. Sherman, Justin. (2020-09-25). "Russia Is Trying Something New to Isolate Its Internet From the Rest of the World".
  29. TLS Working Group. (July 26, 2023). "Minutes IETF117: tls: Wed 20:00".
  30. TLS Working Group. (July 26, 2023). "IETF117-TLS-20230726-2000". Internet Engineering Task Force.
  31. "Encrypted Client Hello - the last puzzle piece to privacy".
  32. "Encrypted Client Hello (ECH) - Frequently asked questions {{!}} Firefox Help".
  33. . (9 October 2023). ["How to disable TLS Encrypted ClientHello in Google Chrome using PowerShell"](https://chasersystems.com/blog/disabling-encrypted-clienthello-in-google-chrome-and-why/). *Chaser Systems Ltd*.
  34. . (12 December 2023). ["Feature: TLS Encrypted Client Hello (ECH)"](https://chromestatus.com/feature/6196703843581952). *[[Google]]*.
  35. "EdelKey Project".
  36. "OpenSSL CHANGES".
  37. "Public Git Hosting - alpine.git/Commit".
  38. (2023-07-25). "How to improve privacy in Microsoft Edge by enabling Encrypted Client Hello".
  39. (2022-08-24). "Developing ECH for OpenSSL (DEfO)".
  40. "Understand Encrypted Client Hello (ECH) {{!}} Firefox Help".
  41. "curl/docs/ECH.md at cbe7fad20d969626a5c4eb0501a273dfe812bcd3 · curl/curl".
  42. "curl/docs/ROADMAP.md at 50490c0679fcd0e50bb3a8fbf2d9244845652cf0 · curl/curl".
  43. "Feature: TLS Encrypted Client Hello (ECH)".
  44. (September 2013). "Release Notes Version 7.8". Campus@Barracuda.
  45. (September 2015). "Release Notes Version 5.2". Campus@Barracuda.
  46. (29 October 2017). "Bug 765064 – HttpClient in use by Sync and other services doesn't support SNI". Bugzilla@Mozilla.
  47. "IBM HTTP Server SSL Questions and Answers". [[IBM]].
  48. (17 October 2013). "IHS 8 powered by Apache 2.2.x ?". [[IBM]].
  49. "#2275 (Support Encrypted Client Hello) – nginx".
  50. https://github.com/caddyserver/caddy/releases/tag/v2.10.0
  51. "Performance improvements".
  52. "ECH by kazuho · Pull Request #3164 · h2o/h2o".
  53. "Base Directives - Configure".
  54. "Update to draft-ietf-tls-esni-13".
  55. "Dell BSAFE Micro Edition Suite 5.0 Release Advisory".
  56. (2018-10-27). "Support ECH (#595) · Issues · gnutls / GnuTLS · GitLab".
  57. "Support ESNI · Issue #546 · libressl/portable".
  58. "116168 - TLS server name indication extension support in NSS".
  59. "D101050 Bug 1681585 - Add ECH support to selfserv.".
  60. (11 November 2006). "Bug 360421 – Implement TLS Server Name Indication for servers". Bugzilla@Mozilla.
  61. "Support Encrypted Client Hello (formerly known as ESNI) · Issue #7482 · openssl/openssl".
  62. "[ech] rewrite ESNI to ECH draft 15 by kazuho · Pull Request #437 · h2o/picotls".
  63. McCarney, Daniel. (2024-05-31). "Server-side Encrypted Client Hello (ECH) support".
  64. "Certificate selection for servers is missing · Issue #310 · apple/swift-nio-ssl".
  65. "Adds support for TLS v1.3 Encrypted Client Hello (ECH) draft-ietf-tls… · wolfSSL/wolfssl@6b6ad38".
  66. "crypto/tls: implement draft-ietf-tls-esni-13 · cloudflare/go@4c13101".
  67. (2023-04-05). "src/tls.c · master · Hugo Leisink / Hiawatha web server · GitLab".
  68. "lighttpd TLS ECH".
  69. "HAProxy 1.5 changelog".
  70. "ECH (Encrypted client hello) support · Issue #1924 · haproxy/haproxy".
  71. "OpenBSD 6.1 What's New".
  72. "src/lib/libtls/tls.c at master · openbsd/src".
Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Server Name Indication — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report