Server Name Indication
{{short description|TLS extension for serve multiple HTTPS sites at the same IP address with different certificates}}
{{Use dmy dates|date=February 2021}}
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.{{cite IETF |title=Transport Layer Security (TLS) Extensions |rfc=3546 |sectionname=Server Name ssl_ocsp_responderIndication |section=3.1 |page=8 |last1=Blake-Wilson |first1=Simon |last2=Nystrom |first2=Magnus |last3=Hopwood |first3=David |last4=Mikkelsen |first4=Jan |last5=Wright |first5=Tim |date=June 2003 |publisher=IETF |issn=2070-1721}} 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 TLS/SSL 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 {{IETF RFC|3546}}
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{{cite web |title=What is a Multiple Domain (UCC) SSL Certificate? |publisher=GoDaddy |url=https://www.godaddy.com/help/what-is-a-multiple-domain-ucc-ssl-certificate-3908}} 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.{{cite web |work=Paul's Journal |title=TLS Server Name Indication |url=https://paul.querna.org/articles/2005/04/24/tls-server-name-indication/ |access-date=2024-07-03}} 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{{cite web |title=Web Filter: SNI extension feature and HTTPS blocking |website=www3.trustwave.com |url=https://support.trustwave.com/software/8e6/hlp/r3000/files/1system_filter.html |access-date=2024-07-03}}{{cite web |title=Sophos UTM: Understanding Sophos Web Filtering |website=Sophos Community |url=https://community.sophos.com/kb/en-us/115865 |access-date=2019-02-20}}{{cite book |last1=Chrisment |first1=Isabelle |last2=Goichot |first2=Antoine |last3=Cholez |first3=Thibault |last4=Shbair |first4=Wazen M. |title=2015 IFIP/IEEE International Symposium on Integrated Network Management (IM) |date=2015-05-11 |chapter=Efficiently Bypassing SNI-based HTTPS Filtering |pages=990–995 |isbn=978-1-4799-8241-7 |chapter-url=https://inria.hal.science/hal-01202712/document |doi=10.1109/INM.2015.7140423 |s2cid=14963313|url=https://hal.inria.fr/hal-01202712/file/IM2015-Camera-Ready.pdf }} and governments to implement censorship.{{cite web |title=South Korea is Censoring the Internet by Snooping on SNI Traffic |website=BleepingComputer |url=https://www.bleepingcomputer.com/news/security/south-korea-is-censoring-the-internet-by-snooping-on-sni-traffic/ |access-date=2019-02-18}}
Presently, there are multiple technologies attempting to hide Server Name Indication:
=Domain fronting=
{{Main|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,{{cite web |title=Encrypted chat app Signal circumvents government censorship |website=Engadget |url=https://www.engadget.com/2016-12-21-signal-egypt-uae-censorship-block-domain-fronting.html |access-date=2024-07-03}} 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.{{cite web |title=Amazon threatens to suspend Signal's AWS account over censorship circumvention |website=Signal |url=https://signal.org/blog/looking-back-on-the-front/ |access-date=2018-05-02}}
=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.{{cite report |title=TLS Encrypted Client Hello |last1=Rescorla |first1=Eric |last2=Oku |first2=Kazuho |date=2023-10-09 |publisher=Internet Engineering Task Force |issue=draft-ietf-tls-esni-17 |last3=Sullivan |first3=Nick |last4=Wood |first4=Christopher A. |url=https://datatracker.ietf.org/doc/draft-ietf-tls-esni/}} 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){{cite web |title=Draft-ietf-TLS-esni-14 |date=6 April 2023 |last1=Rescorla |first1=Eric |last2=Oku |first2=Kazuho |last3=Sullivan |first3=Nick |last4=Wood |first4=Christopher A. |url=https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni}} and its implementations were rolled out in an "experimental" fashion to address this risk of domain eavesdropping.{{cite web |title=ESNI: A Privacy-Protecting Upgrade to HTTPS |work=EFF DeepLinks Blog |date=24 September 2018 |url=https://www.eff.org/deeplinks/2018/09/esni-privacy-protecting-upgrade-https}}{{cite news |last1=Claburn |first1=Thomas |date=17 July 2018 |title=Don't panic about domain fronting, an SNI fix is getting hacked out |work=The Register |url=https://www.theregister.com/2018/07/17/encrypted_server_names/ |access-date=10 October 2018}}{{cite web |last=Ghedini |first=Alessandro |date=2018-09-24 |title=Encrypt it or lose it: how encrypted SNI works |website=The Cloudflare Blog |language=en |url=https://blog.cloudflare.com/encrypted-sni/ |access-date=2019-05-13}} Firefox 85 removed support for ESNI.{{cite web |title=1667743 - Clean up unused esni code |website=bugzilla.mozilla.org |language=en |url=https://bugzilla.mozilla.org/show_bug.cgi?id=1667743 |access-date=2022-04-07}} 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{{cite web |last1=Eric |first1=Rescorla |title=Encrypted SNI Comes to Firefox Nightly |website=Mozilla Security Blog |date=18 October 2018 |url=https://blog.mozilla.org/security/2018/10/18/encrypted-sni-comes-to-firefox-nightly/ |access-date=15 June 2020}} and required enabling DNS over HTTPS (DoH).{{cite web |last1=Daniel |first1=Stenberg |title=Curl: Re: Support of Encrypted SNI (curl-library mailing list archive) |website=curl.se |url=https://curl.se/mail/lib-2019-03/0000.html |access-date=15 June 2020}}
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.{{cite web |last=Jacobs |first=Kevin |title=Encrypted Client Hello: the future of ESNI in Firefox |website=Mozilla Security Blog |date=7 January 2021 |url=https://blog.mozilla.org/security/2021/01/07/encrypted-client-hello-the-future-of-esni-in-firefox/ |access-date=2021-01-09}} The short name was ECHO in March 2020{{cite web |title=ESNI -> ECHO · tlswg/draft-ietf-tls-esni |website=GitHub |url=https://github.com/tlswg/draft-ietf-tls-esni/pull/207}} and changed to ECH in May 2020.{{cite web |title=s/ECHO/ECH · tlswg/draft-ietf-tls-esni |website=GitHub |url=https://github.com/tlswg/draft-ietf-tls-esni/pull/236}}
Both ESNI and ECH are compatible only with TLS 1.3 because they rely on KeyShareEntry which was first defined in TLS 1.3.{{cite web |last=Ghedini |first=Alessandro |date=2018-09-24 |title=Encrypt it or lose it: how encrypted SNI works |website=The Cloudflare Blog |language=en |url=https://blog.cloudflare.com/encrypted-sni/ |access-date=2019-05-13 |quote=this is an extension to TLS version 1.3 and above, and doesn't work with previous versions of the protocol}}{{cite web |title=Make ESNI TLS 1.2 compatible · Issue #38 · tlswg/draft-ietf-tls-esni |website=GitHub |url=https://github.com/tlswg/draft-ietf-tls-esni/issues/38 |access-date=2020-08-09}} Also, to use ECH, the client must not propose TLS versions below 1.3.{{cite web |last=Rescorla |first=Eric |title=TLS Encrypted Client Hello |website=tlswg.org |language=en |url=https://tlswg.org/draft-ietf-tls-esni/draft-ietf-tls-esni.html |access-date=2021-02-24 |quote=The client ... MUST offer to negotiate TLS 1.3 or above.}}
Another Internet Draft incorporates a parameter for transmitting the ECH public keys via HTTPS and SVCB DNS record types, shortening the handshake process.{{cite web |title=Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs) |last1=Schwartz |first1=Benjamin M. |last2=Bishop |first2=Mike |date=2023-03-11 |publisher=Internet Engineering Task Force |issue=draft-ietf-dnsop-svcb-https |last3=Nygren |first3=Erik |url=https://datatracker.ietf.org/doc/draft-ietf-dnsop-svcb-https |access-date=2023-07-25}}{{cite web |last1=Schwartz |first1=Benjamin M. |last2=Bishop |first2=Mike |last3=Nygren |first3=Erik |title=Bootstrapping TLS Encrypted ClientHello with DNS Service Bindings |date=2023-09-26 |publisher=Internet Engineering Task Force |issue=draft-ietf-tls-svcb-ech |url=https://datatracker.ietf.org/doc/draft-ietf-tls-svcb-ech/ |access-date=2023-10-01}}
In August 2020, the Great Firewall of China started blocking ESNI traffic, while still allowing ECH traffic.{{cite web |last=Cimpanu |first=Catalin |title=China is now blocking all encrypted HTTPS traffic that uses TLS 1.3 and ESNI |website=ZDNet |url=https://www.zdnet.com/article/china-is-now-blocking-all-encrypted-https-traffic-using-tls-1-3-and-esni/ |access-date=2020-08-09}}
In October 2020, Russian ISP Rostelecom and its mobile operator Tele2 started blocking ESNI traffic.{{cite web |title=Почему Ростелеком блокирует ESNI трафик? |language=ru |date=11 October 2020 |website=qna.habr.com |url=https://qna.habr.com/q/862669 |access-date=30 October 2020}} 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.{{cite web |title=Russia's Digital Development Ministry wants to ban the latest encryption technologies from the RuNet |website=Meduza |language=en |url=https://meduza.io/en/feature/2020/09/22/russia-s-digital-development-ministry-wants-to-ban-the-latest-encryption-technologies-from-the-runet |access-date=2021-06-18}}{{cite web |last=Cimpanu |first=Catalin |title=Russia wants to ban the use of secure protocols such as TLS 1.3, DoH, DoT, ESNI |website=ZDNet |language=en |url=https://www.zdnet.com/article/russia-wants-to-ban-the-use-of-secure-protocols-such-as-tls-1-3-doh-dot-esni/ |access-date=2021-06-18}}{{cite web |last=Sherman |first=Justin |date=2020-09-25 |title=Russia Is Trying Something New to Isolate Its Internet From the Rest of the World |website=Slate Magazine |language=en |url=https://slate.com/technology/2020/09/russia-internet-encryption-protocol-ban.html |access-date=2021-06-18}}
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.{{cite web |author=TLS Working Group |date=July 26, 2023 |title=Minutes IETF117: tls: Wed 20:00 |website=IETF Datatracker |url=https://datatracker.ietf.org/doc/minutes-117-tls-202307262000/ |access-date=2023-08-02 |url-status=live |archive-url=https://web.archive.org/web/20230802105927/https://datatracker.ietf.org/doc/minutes-117-tls-202307262000/ |archive-date=2023-08-02}}{{cite AV media |author=TLS Working Group |title=IETF117-TLS-20230726-2000 |date=July 26, 2023 |website=YouTube |type=video |language=en |publisher=Internet Engineering Task Force |place=San Francisco |url=https://www.youtube.com/watch?v=oNoRithKw00 |access-date=2023-08-02}}
In Sep 2023, Cloudflare started to support ECH for hosted domains.{{cite web |title=Encrypted Client Hello - the last puzzle piece to privacy |author1=Achiel van der Mandele |author2=Alessandro Ghedini |author3=Christopher Wood |author4=Rushil Mehra |website=The Cloudflare Blog |url=https://blog.cloudflare.com/announcing-encrypted-client-hello/ |access-date=1 October 2023}}
ECH is enabled in Firefox by default since version 119, and is recommended by Mozilla to be used along with DNS over HTTPS.{{cite web |title=Encrypted Client Hello (ECH) - Frequently asked questions {{!}} Firefox Help |website=support.mozilla.org |url=https://support.mozilla.org/en-US/kb/faq-encrypted-client-hello#w_how-do-i-know-ech-is-available-for-me |access-date=1 Dec 2024}} 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.{{cite web |title=How to disable TLS Encrypted ClientHello in Google Chrome using PowerShell |author= |date=9 October 2023 |publisher=Chaser Systems Ltd |url=https://chasersystems.com/blog/disabling-encrypted-clienthello-in-google-chrome-and-why/}}{{cite web |title=Feature: TLS Encrypted Client Hello (ECH) |author= |date=12 December 2023 |website=Chrome Platform Status |publisher=Google |url=https://chromestatus.com/feature/6196703843581952 |access-date=21 February 2024}}
Implementation
In 2004, a patch for adding TLS/SNI into OpenSSL was created by the EdelKey project.{{cite web |title=EdelKey Project |website=edelweb.fr |url=http://www.edelweb.fr/EdelKey/files/ |access-date=2019-02-20}} 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{{cite web |title=OpenSSL CHANGES |url=https://www.openssl.org/news/cl098.txt |url-status=dead |archive-url=https://web.archive.org/web/20160420213610/https://www.openssl.org/news/cl098.txt |archive-date=20 April 2016}}). 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.{{Citation needed|date=March 2021}}
Support
References
{{Reflist}}
External links
- {{IETF RFC|6066|link=no}} (obsoletes {{IETF RFC|4366|link=no}}, which obsoleted {{IETF RFC|3546|link=no}})
- [https://wiki.mozilla.org/Security/Encrypted_Client_Hello Mozilla Wiki - Encrypted Client Hello (ECH)]
{{TLS/SSL}}