Server Name Indication

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.[1] This allows a server to present multiple 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 TLS/SSL handshake. The desired hostname is not encrypted in the original SNI extension, so an eavesdropper can see which site is being requested.

Background of the problem

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 difficult — 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). Since 2005, CAcert has run experiments on different methods of using TLS on virtual servers.[2] Most of the experiments are unsatisfactory and impractical. For example, it is possible to use subjectAltName to contain multiple domains controlled by one person[3] 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.[4] 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[5][6][7] and governments to implement censorship.[8] Presently, there are multiple technologies attempting to encrypt Server Name Indication.

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 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,[9] 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.[10]

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)[11] and its implementations rolled out in an "experimental" fashion to address this risk of domain eavesdropping.[12][13][14] In contrast to ECH, Encrypted SNI encrypted just the SNI rather than the whole Client Hello.[15] Opt-in support for this version was incorporated into Firefox in October 2018[16] and required enabling DNS-over-HTTPS.[17]

In March 2020, ESNI was reworked into ECH extension, after analysis demonstrated that encrypting only the SNI is insufficient. For example, specifications permit 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.[18] The short name was ECHO in March 2020[15] and changed to ECH in May 2020.[19]

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

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

In October 2020, Russian ISP Rostelecom and its mobile operator Tele2 started blocking ESNI traffic.[22]

Implementation

In 2004, a patch for adding TLS/SNI into OpenSSL was created by the EdelKey project.[23] 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[24]).

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

Support for SNI[2]
SoftwareTypeSupportedNotesSupported since
Alpine (email client)IMAP email clientYesSince version 2.22[25]2019-02-18
Internet ExplorerWeb browserYesSince version 7 on Vista (not supported on XP)2006
EdgeWeb browserYesAll versions
Mozilla FirefoxWeb browserYesSince version 2.02006
cURLCommand-line tool and libraryYesSince version 7.18.12008
SafariWeb browserYesNot supported on Windows XP
Google ChromeWeb browserYes2010
BlackBerry 10Web browserYesSupported in all BB10 releases2013
BlackBerry OSWeb browserNot supported in 7.1 or earlier
Barracuda WAFReverse ProxyYesSupported since version 7.8 [26]2013
Barracuda ADCLoad balancerYesFrontend support since version 4.0 and backend support from v5.2 [27]Frontend 2013 / Backend 2015
Windows MobileWeb browserSome time after 6.5
Android default browserWeb browserYesHoneycomb (3.x) for tablets and Ice Cream Sandwich (4.x) for phones2011
Firefox for AndroidWeb browserPartialSupported for browsing. Sync and other services don't support SNI[28][29]
wgetCommand-line toolYesSince version 1.142012
Nokia Browser for SymbianWeb browserNo
Opera Mobile for SymbianWeb browserNoNot supported on Series60
DilloWeb browserYesSince version 3.12016
IBM HTTP ServerWeb serverYesSince version 9.0.0[30][31]
Apache TomcatWeb serverYesNot supported before 8.5 (backport from 9)
Apache HTTP ServerWeb serverYesSince version 2.2.122009
Microsoft IISWeb serverYesSince version 82012
nginxWeb serverYesSince version 0.5.232007
JettyWeb serverYesSince version 9.3.02015
HCL DominoWeb serverYesSince version 11.0.12020
QtLibraryYesSince version 4.82011
Mozilla NSS server sideLibraryNo[32]
4th DimensionLibraryNoNot supported in 15.2 or earlier
JavaLibraryYesSince version 1.72011
ColdFusion / LuceeLibraryYesColdFusion since Version 10 Update 18, 11 Update 7, Lucee since Version 4.5.1.019, Version 5.0.0.502015
ErlangLibraryYesSince version r172013
GoLibraryYesSince version 1.42011
PerlLibraryYesSince Net::SSLeay version 1.50 and IO::Socket::SSL version 1.562012
PHPLibraryYesSince version 5.32014
PythonLibraryYesSupported 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
RubyLibraryYesSince version 2.0 (in net/http)2011
HiawathaWeb serverYesSince version 8.62012
lighttpdWeb serverYesSince version 1.4.242009
HAProxyLoad balancerYesSince version 1.5-dev12[33]2012

References

  1. Blake-Wilson, Simon; Nystrom, Magnus; Hopwood, David; Mikkelsen, Jan; Wright, Tim (June 2003). "Server Name Indication". Transport Layer Security (TLS) Extensions. IETF. p. 8. sec. 3.1. doi:10.17487/RFC3546. ISSN 2070-1721. RFC 3546.
  2. "CAcert VHostTaskForce". CAcert Wiki. Archived from the original on 22 August 2009. Retrieved 27 October 2008.
  3. "What is a Multiple Domain (UCC) SSL Certificate?". GoDaddy.
  4. "TLS Server Name Indication". Paul's Journal.
  5. "Web Filter: SNI extension feature and HTTPS blocking". www3.trustwave.com. Retrieved 20 February 2019.
  6. "Sophos UTM: Understanding Sophos Web Filtering". Sophos Community. Retrieved 20 February 2019.
  7. Chrisment, Isabelle; Goichot, Antoine; Cholez, Thibault; Shbair, Wazen M. (11 May 2015). "Efficiently Bypassing SNI-based HTTPS Filtering". 2015 IFIP/IEEE International Symposium on Integrated Network Management (IM). pp. 990–995. doi:10.1109/INM.2015.7140423. ISBN 978-1-4799-8241-7. S2CID 14963313.
  8. "South Korea is Censoring the Internet by Snooping on SNI Traffic". BleepingComputer. Retrieved 18 February 2019.
  9. "Encrypted chat app Signal circumvents government censorship". Engadget. Retrieved 4 January 2017.
  10. "Amazon threatens to suspend Signal's AWS account over censorship circumvention". Signal. Retrieved 2 May 2018.
  11. https://tools.ietf.org/html/draft-ietf-tls-esni
  12. "ESNI: A Privacy-Protecting Upgrade to HTTPS". EFF DeepLinks Blog.
  13. Claburn, Thomas (17 July 2018). "Don't panic about domain fronting, an SNI fix is getting hacked out". The Register. Retrieved 10 October 2018.
  14. "Encrypt it or lose it: how encrypted SNI works". The Cloudflare Blog. 24 September 2018. Retrieved 13 May 2019.
  15. "ESNI -> ECHO · tlswg/draft-ietf-tls-esni".
  16. Eric, Rescorla. "Encrypted SNI Comes to Firefox Nightly". Mozilla Security Blog. Retrieved 15 June 2020.
  17. Daniel, Stenberg. "curl-library mailing list archive". curl.haxx.se. Retrieved 15 June 2020.
  18. Jacobs, Kevin. "Encrypted Client Hello: the future of ESNI in Firefox". Mozilla Security Blog. Retrieved 9 January 2021.
  19. "s/ECHO/ECH · tlswg/draft-ietf-tls-esni".
  20. "Make ESNI TLS 1.2 compatible · Issue #38 · tlswg/draft-ietf-tls-esni". GitHub. Retrieved 9 August 2020.
  21. Cimpanu, Catalin. "China is now blocking all encrypted HTTPS traffic that uses TLS 1.3 and ESNI". ZDNet. Retrieved 9 August 2020.
  22. "Почему Ростелеком блокирует ESNI трафик?". qna.habr.com (in Russian). 11 October 2020. Retrieved 30 October 2020.
  23. "EdelKey Project". www.edelweb.fr. Retrieved 20 February 2019.
  24. "OpenSSL CHANGES". Archived from the original on 20 April 2016.
  25. https://repo.or.cz/alpine.git/commit/08fcd1b86979b422eb586e56459d6fe15333e500
  26. "Release Notes Version 7.8". Campus@Barracuda. September 2013. Retrieved 5 January 2021.
  27. "Release Notes Version 5.2". Campus@Barracuda. September 2015. Retrieved 5 January 2021.
  28. "Bug 765064 — HttpClient in use by Sync and other services doesn't support SNI". Bugzilla@Mozilla. 29 October 2017. Retrieved 9 November 2017.
  29. "Bug 1412650 — Switch services.* code to use HttpsURLConnection". Bugzilla@Mozilla. 29 October 2017. Retrieved 9 November 2017.
  30. "IBM HTTP Server SSL Questions and Answers". IBM. Retrieved 8 March 2011.
  31. "IHS 8 powered by Apache 2.2.x ?". IBM. 17 October 2013. Archived from the original on 26 December 2015. Retrieved 9 November 2017.
  32. "Bug 360421 — Implement TLS Server Name Indication for servers". Bugzilla@Mozilla. 11 November 2006. Retrieved 30 October 2012.
  33. "HAProxy 1.5 changelog". Retrieved 28 December 2020.

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.