Understanding the TLS Handshake: The Mechanics Behind Your Secure Connection π
When you browse the web, that reassuring padlock icon you see in your browser signifies a secure connection between you and the website. But what exactly happens behind the scenes to establish that secure link? In this post, we will delve into the intricate process known as the TLS handshake, revealing the steps involved in ensuring your data remains private and secure.
To help illustrate this process, I recommend keeping an infographic handy, which displays the various messages exchanged between your web browser (the Client) and the website (the Server) during the initiation of a TLS session.
The Objectives of SSL/TLS
Before we start, it’s essential to understand the fundamental aims of SSL/TLS:
- Authentication: Ensuring that the Server is indeed who it claims to be.
- Secure Data Transfer: Establishing session keys that safeguard the data exchange.
Letβs explore the handshake by breaking it down into its components.
1. Client Hello
The handshake commences with the Client sending a Client Hello message. This initial message contains five critical fields:
- SSL Version: The highest version of SSL/TLS supported by the Client.
- Random Number: 32 bytes of random data generated by the Client.
- Session ID: A request for establishing a session, if applicable.
- Cipher Suites: A list of supported cipher suites for encryption.
- Extensions: Optional fields that add features to the SSL/TLS protocol.
These elements serve as the foundation for the subsequent secure connection.
SSL Version
The Client specifies the highest SSL version it supports, such as SSL 3.0
, TLS 1.0
, TLS 1.2
, or TLS 1.3
. The Server responds with its supported version, and they agree to utilize the highest common version.
Random Number
The Client contributes a random number that will enhance the complexity of the session keys, introducing what’s known as “entropy.”
Session ID
This feature allows for session resumption, enabling faster reconnections by referencing a previously established session. In our example, however, we will focus solely on a full handshake process.
Cipher Suites
The Client presents a list of cipher suites it supports. The Server selects one from this list, which will dictate the encryption methods used during the session.
Extensions
Extensions are additional features that can enhance
Share this content: