Jump to content

Server Name Indication

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JavaProphet (talk | contribs) at 03:54, 16 August 2015 (Added Avuna to list of supported servers for SNI.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Server Name Indication (SNI) is an extension to the TLS computer networking protocol[1] by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process. 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 off 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.

To make use of SNI practical, the vast majority of users must use web browsers that implement it. Users whose browsers do not implement SNI are presented with a default certificate and hence are likely to receive certificate warnings, unless the server is equipped with a wildcard certificate that matches the name of the website.

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.

It is possible for one certificate to cover multiple hostnames. The X.509 v3 specification introduced the subjectAltName field which allows one certificate to specify more than one domain and the usage of wildcards in both the common name and subjectAltName fields. However it may be impractical—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. As such 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 is 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 can be served from the same IP address.

In practice, this means that an HTTPS server can only serve one domain (or small group of domains) per IP address for secured 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 in short supply. The result is that many websites are effectively prevented from using secure communications over IPv4. IPv6 naturally deals in blocks of IP addresses at a time so is unaffected by this issue.

How SNI fixes the problem

SNI addresses this issue by having the client send the name of the virtual domain as part of the TLS negotiation.[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.

Implementation

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

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.

Web browsers[6]

Servers

Libraries

  • Mozilla NSS 3.11.1[33] client-side only
  • OpenSSL
    • 0.9.8f (released 11 October 2007) - not compiled in by default, can be compiled in with config option '--enable-tlsext'.
    • 0.9.8j (released 7 January 2009) through 1.0.0 (released 29 March 2010) - compiled in by default
  • GnuTLS[34]
  • wolfSSL (previously CyaSSL) - not compiled in by default, can be compiled in with config option '--enable-sni' or '--enable-tlsx'.[35]
  • mbed TLS (previously PolarSSL) since 1.2.0 - compiled in by default
  • libcurl / cURL since 7.18.1 (released 30 March 2008) when compiled against an SSL/TLS toolkit with SNI
  • Python 2.7.9, 3.2 and above (ssl, urllib[2] and httplib modules) [36]
  • Qt 4.8[37]
  • Oracle Java 7 JSSE [38]
  • Apache HttpComponents 4.3.2 [39]
  • wget 1.14[40]
  • Android 2.3 (Gingerbread) has partial support if application uses HttpsURLConnection class.[41]
  • Android 4.2 (Jellybean MR1) exposes SNI support on raw sockets via its SSLCertificateSocketFactory class.[42]
  • IO::Socket::SSL (Perl/CPAN module, client support since version 1.56,[43] server support since 1.83[43])
  • Pike 7.9.5 (SSL module) [44]
  • MatrixSSL (client and server)[45]
  • stunnel (client and server)[46]
  • Go (client and server)[47]

No support

The following combinations do not implement SNI:

Client side

Server side

Libraries

  • Qt client side up to 4.7[37]
  • Mozilla NSS server side [53][54]
  • Java before 1.7
  • Python 2.x (except 2.7.9), 3.0, 3.1 (ssl, urllib[2] and httplib modules) [36]

References

  1. ^ "Server Name Indication". Transport Layer Security (TLS) Extensions. IETF. p. 8. sec. 3.1. doi:10.17487/RFC3546. RFC 3546.
  2. ^ "CAcert VHostTaskForce". CAcert Wik.
  3. ^ "What is a Multiple Domain (UCC) SSL Certificate?".
  4. ^ "TLS Server Name Indication". Paul's Journal.
  5. ^ "EdelKey Project".
  6. ^ Brand, Kaspar (29 March 2009). "TLS SNI Test Site".
  7. ^ http://blogs.msdn.com/b/ieinternals/archive/2009/12/07/certificate-name-mismatch-warnings-and-server-name-indication.aspx
  8. ^ Opera (25 February 2005). "Changelog for Opera [8] Beta 2 for Windows". Opera Changelogs for Windows. Opera.com. Archived from the original (via Archive.org) on 23 November 2005. Readded experimental support for TLS Extensions and TLS 1.1. Setting is disabled by default. {{cite web}}: External link in |work= (help)
  9. ^ "Google Chrome, Issue 43142, Use SSLClientSocketNSS on Windows by default". 29 October 2010.
  10. ^ "Bug 122433: Server Name Identification support". Bugs.kde.org. Retrieved 18 July 2011.
  11. ^ Kehrer, Paul. "SNI in iOS 4.0". Retrieved 22 November 2010.
  12. ^ "Issue 12908 - android Https - websites that support Server Name Indication (SNI) don't work". code.google.com. Retrieved 23 August 2011.
  13. ^ Server Name Indication (SNI) with IIS 8 (Windows Server 2012) - Unleashed - Site Home - MSDN Blogs
  14. ^ "Bug 34607: Support for Server Name Indication". Apache Software Foundation.
  15. ^ "Revision 776281: adding support for Server Name Indication to the Apache 2.2.x branch". Apache Software Foundation.
  16. ^ "CHANGES: Server Name Indication support is listed under the changes for Apache 2.2.12". Apache Software Foundation.
  17. ^ Notaras, George (10 August 2007). "SSL-enabled Name-based Apache Virtual Hosts with mod_gnutls".
  18. ^ "What's New in IIS 8". weblogs.asp.net. Retrieved 1 April 2012.
  19. ^ "#386 (TLS servername extension (SNI) for namebased TLS-vhosts)". Trac.lighttpd.net. Retrieved 8 March 2011.
  20. ^ "1.4.24 - now with TLS SNI and money back guarantee". Blog.lighttpd.net. Retrieved 8 March 2011.
  21. ^ "sol13452: Configuring a virtual server to serve multiple HTTPS sites using TLS Server Name Indication (SNI) feature". ask.f5.com. Retrieved 26 March 2012.
  22. ^ "Apsis Gmbh". apsis.ch. Retrieved 18 August 2011.
  23. ^ "Open Source PageKite". PageKite.net. Retrieved 18 April 2012.
  24. ^ "SSL/TLS back-ends, endpoints and SNI". PageKite.net. Retrieved 18 April 2012.
  25. ^ Features of Saetta web server
  26. ^ "Unified Reverse Proxy". TCOGROUP. {{cite web}}: Cite has empty unknown parameter: |1= (help)
  27. ^ "Configuring an SSL Virtual Server for Secure Hosting of Multiple Sites". Citrix. Retrieved 5 July 2012.
  28. ^ "Introducing AlteonOS 28.1! - Knowledge Base - Radware". kb.radware.com. Retrieved 20 August 2012.
  29. ^ "HAProxy - The Reliable, High Performance TCP/HTTP Load Balancer".
  30. ^ "EVO Mail Server with TLS SNI support".
  31. ^ "FortiWeb 5.3.0 CLI Reference - server certificate sni". http://docs.fortinet.com/d/fortiweb-5-3-0-cli-html. Retrieved 2 January 2015. {{cite web}}: External link in |publisher= (help)
  32. ^ "Avuna HTTP SNI Built in Support".
  33. ^ "NSS 3.11.1 Release Notes". Mozilla.org. Retrieved 8 March 2011.
  34. ^ "TLS Extensions". Gnu.org. 1 August 2010. Retrieved 8 March 2011.
  35. ^ "Using Server Name Indication (SNI) with CyaSSL". wolfSSL.com. 24 May 2013. Retrieved 25 November 2013.
  36. ^ a b "Support TLS SNI extension in ssl module". Bugs.python.org. Retrieved 8 March 2011.
  37. ^ a b "QTBUG-1352. It would be useful if QSslSocket supports TLS extensions such as Server Name Indication as per RFC 3546". Qt Bug Tracker. Retrieved 15 April 2011.
  38. ^ "Java SE 7 Release Security Enhancements". download.oracle.com. Retrieved 12 December 2012.
  39. ^ "HttpComponents HttpClient 4.3.2 Released". Retrieved 21 January 2014.
  40. ^ "News: GNU wget 1.14 released". GNU Wget. 19 October 2012.
  41. ^ "Android's HTTP Clients". Google. Retrieved 3 August 2012.
  42. ^ "SSLCertificateSocketFactory | Android Developers". Google. Retrieved 9 January 2015.
  43. ^ a b "IO::Socket::SSL introduces client-side SNI".
  44. ^ "Pike's SSL module". Retrieved 30 August 2013.
  45. ^ "MatrixSSL news page".
  46. ^ "stunnel man page".
  47. ^ "Go TLS package".
  48. ^ "Understanding Certificate Name Mismatches". Blogs.msdn.com. Retrieved 8 March 2011.
  49. ^ "Android issue 1290 - Https websites that support Server Name Indication (SNI) don't work". Code.google.com. 1 December 2010. Retrieved 13 December 2011.
  50. ^ "IBM HTTP Server SSL Questions and Answers". Publib.boulder.ibm.com. Retrieved 8 March 2011.
  51. ^ "IHS 8 powered by Apache 2.2.x ?". Publib.boulder.ibm.com. Retrieved 8 March 2011.
  52. ^ "Stack Overflow post by a Tomcat Comitter". Retrieved 28 October 2014.
  53. ^ "NSS Roadmap (as of 11 September 2009)". Wiki.mozilla.org. Retrieved 8 March 2011.
  54. ^ "Implement TLS Server Name Indication for servers". Bugzilla@Mozilla. 11 November 2006. Retrieved 30 October 2012.