Encrypted TLS/SSL Handshake
Total Page:16
File Type:pdf, Size:1020Kb
Masking Host Identity on Internet: Encrypted TLS/SSL Handshake Vinod S. Khandkar and Manjesh K. Hanawal Industrial Engineering and Operations Research Indian Institute of Technology Bombay, Mumbai, India fvinod.khandkar, [email protected] Abstract—Network middle-boxes often classify the traffic flows “Domain name Service” (DNS) database associated with the on the Internet to perform traffic management or discriminate network address is also a primary source of revealing traffic one traffic against the other. As the widespread adoption of flow identity. However, with the adoption of “DNS over TLS” HTTPS protocol has made it difficult to classify the traffic looking into the content field, one of the fields the middle-boxes look for is [3] techniques, the DNS information is encrypted over the Server Name Indicator (SNI), which goes in plain text. SNI field Internet. That means it is not readily available to network contains information about the host and can, in turn, reveal the middle-boxes for traffic flow identification. That leads to the type of traffic. This paper presents a method to mask the server SNI based traffic stream identification [4] as a widely used host identity by encrypting the SNI. We develop a simple method technique over the Internet. that completes the SSL/TLS connection establishment over two handshakes - the first handshake establishes a secure channel without sharing SNI information, and the second handshake shares the encrypted SNI. Our method makes it mandatory for fronting servers to always accept the handshake request without the SNI and respond with a valid SSL certificate. As there is no modification in already proven SSL/TLS encryption mechanism and processing of handshake messages, the new method enjoys all security benefits of existing secure channel establishment and needs no modification in existing routers/middle-boxes. Using customized client-server over the live Internet, we demonstrate the feasibility of our method. Moreover, the impact analysis shows that the method adheres to almost all SSL/TLS related Internet standards requirements. Index Terms—TLS, SSL, SNI I. INTRODUCTION Fig. 1. SNI based traffic shaping illustrated using commercial traffic shaper The advent of modern content delivery techniques has The network middle-boxes can manipulate throughput of increased Internet traffic many folds over the last decade. traffic streams with the correctly identifiable class or server As more users rely on Internet services, data privacy, and host-name. Often, the identification is made based on SNI anonymity over the Internet have become crucial. This need information. Fig. 1 illustrates SNI based traffic shaping using prompted the rise of secured or encrypted data communication commercial traffic shaper. We use a commercial traffic shaper using HTTPS protocol [1]. These days, most of the Internet to throttle throughput of a video stream to 1 Mbps. When services use the HTTPS protocol for providing data anonymity the video stream access mechanism uses the correct SNI, the arXiv:2101.04556v1 [cs.CR] 12 Jan 2021 and security. traffic shaper successfully limits the throughput to 1 Mbps While HTTPS protocol secures the channel content, it also (green curve). When the same video access mechanism does makes the traffic stream unidentifiable by network middle- not use any SNI information or uses non-comprehensible SNI, boxes. It has restricted Internet Service Providers’ (ISPs) with everything else remaining the same, the stream gets ability to efficiently classify the traffic streams that would help throughput of 2:5 Mbps based on bandwidth availability (blue them perform legitimate tasks like traffic management or apply curve). It illustrates that the commercial traffic shaper could discriminatory policies like selective throttling and preferential correctly identify and throttle the video stream in the presence treatment of specific traffic streams. Thus, it has prompted of correct SNI information. In the latter case, it could not ISPs to employ various other techniques to classify traffic [2]. classify the stream and hence did not throttled the throughput. The “Server Name Identification” (SNI) based technique is It validates our claim that the SNI field is essential for the one such commonly used technique. It uses the SNI field middle-boxes/traffic-shapers to correctly classify the traffic in the Transport Layer Security (TLS) handshake protocol streams and apply any traffic management or throttling. message to identify the traffic flow. It is an optional parameter Even though ISP middle-boxes’ service identification and sent as a plain-text in the initial SSL/TLS handshake. The classification aid efficient traffic management, it also gives far more control over the handling of packets related to specific A standardization body acknowledges the need for en- services within the network. The ISP middle-boxes often use crypted SNI (E-SNI) with the related issues and requirements such control to provide higher performance to certain services well documented in the internet-draft [9]. It lists unanticipated while degrading certain services’ performances. There are usage of SNI that includes ISP QoS profiling based on SNI. reports of preferential treatment cases in the past, e.g., Netflix The various E-SNI requirements are categorized as attack v/s Comcast, that prompted various regulating authorities to prevention, fronting server related, and other security consider- advocate net-neutrality. The net-neutrality is related to ‘equal’ ations. The E-SNI is still not available as an Internet standard, treatment of all packets over the Internet. but the internet-draft in an experimental version is available This paper proposes a method to send SNI in a non-plain- [10]. It proposes to encrypt the entire “clientHello” message. text format that prevents the middle-boxes from using it to A slightly different version of it is already implemented identify the traffic class or server host-name. Thus, it paves and commercialized by “Cloudflare” [11] that encrypts only the way for more comprehensive and non-malicious ways of the SNI portion of the “clientHello” message. It uses the managing traffic over the Internet. It will also help prevent Diffie-Hellman key exchange algorithm to generate a shared malicious users from knowing the type of activity performed encryption key over an untrusted channel. This method’s main by users while using public networks through wire-tapping. It drawback is that it requires a considerable amount of pre- applies to all versions of TLS supporting SNI parameter. Our handshake processing and requires the client and server to contributions can be summarized as follows: exchange the public portion of the generated symmetric key to • We develop a method to mask SNI which conceals host’s encrypt and decrypt SNI. This requirement raises the security identity which in turn prevents classification of traffic issues that need mitigation using persistent security credential streams on the Internet modifications. • We validate our method works without requiring any The authors in [12] propose a method of domain fronting changes in the existing routers/middle-boxes by estab- in which the fronting server establishes a secure connection lishing a secure connection between a server-client pair with the client using its server name. Later this connection is over the Internet. extended to the intended content server by establishing another The paper is organized as follows: Section II describes HTTPS tunnel within already established HTTPS tunnel. The the background technologies associated with the proposed major drawback of this method is the increased workload of methodology. Section III describes the design principles fol- double encryption. lowed and the proposed method. Section IV explains modi- Our SNI encryption method is different from the above fication to the existing the TLS handshake to send SNI on methods as it not only encrypts the SNI but performs the entire a secure channel. Section V discusses impacts of various SSL handshake for appropriate SNI within a secured channel. design choices and validates the feasibility of our methods It not only hides SNI from middle-boxes but also the plain- through its implementation on live Internet. The advantages text server certificate. It is thus making the entire SSL/TLS and disadvantages of the proposed method are discussed in handshake in question transparent to network middle-boxes. Section VI with a conclusion in Section VII II. BACKGROUND A. Related Work The method proposed in this paper deals with SNI and Three revisions of TLS protocol have been made since SSL/TLS handshake, along with its operation in various client- its introduction as an improved SSL protocol. The latest server configurations. This section describes these aspects as TLS version is 1.3. It was introduced in 2018. Apart from defined in the standard and deployed in practice. the major TLS/SSL releases, there have been many protocol and parameter related modifications proposed until now. The A. SNI in TLS possibility of improving the basic RSA algorithm’s speed is SNI is an optional field in the “clientHello” message sent investigated using the EAMRSA algorithm in [5]. [6] proposes from the client. This message is part of the initial handshake the new key negotiation mechanism that is ISAKMP based. of the Transport Layer Security (TLS) protocol [13]. IETF Integrating ISAKMP in SSL brings notably new authentication standardized the TLS protocol by taking Secured Socket Layer methods, identity protection, and fast algorithm negotiations. (SSL) as a seed protocol. As of today, it is the most widely The attempt to encrypt/decrypt SSL/TLS handshake parameter deployed protocol for establishing a secure channel. “HTTP is done in [7]. It proposes the Combined Symmetric Key over TLS” or HTTPS standard has adopted the TLS protocol (CSK) based SSL handshake that uses CSK technology to in which the TLS provides channel-oriented security to already authenticate both communication sides and uses the symmetric defined plain-text HTTP protocol. key to encrypt and decrypt secret information, i.e., server The handshake protocol of TLS consists of a “clientHello” authentication code.