Decoding the TLS Handshake: How the Secure Connection Is Established 🔒

Understanding the TLS Handshake: The Process Behind Your Secure Connection 🔒

In this article, we’re diving into the intricacies of the Transport Layer Security (TLS) handshake—essentially, the behind-the-scenes work that gets you that reassuring padlock when visiting secure websites.

To help illustrate this process, I recommend checking out the infographic linked at the end of this post. It visually captures the key messages exchanged between your browser (the Client) and the website’s server during a TLS session.


The Purpose of TLS

Before we delve into each step of the handshake, it’s essential to understand that the primary objectives of TLS are twofold:

  • Authentication: Verifies that the server is who it claims to be.
  • Confidentiality: Establishes session keys to secure the data being exchanged.

With those goals in mind, let’s break down the handshake process into its various components:


1️⃣ Client Hello

The handshake commences with the Client sending a Client Hello message. This includes five key fields:

  • SSL Version
  • Random Number
  • Session ID
  • Cipher Suites
  • Extensions

These components are critical in setting the stage for a secure connection.

1️⃣.1 SSL Version

The Client communicates the highest version of SSL it supports. The server responds in kind, and together they will proceed with the highest mutual SSL/TLS version. Currently, TLS 1.2 and TLS 1.3 are the only versions deemed secure.

1️⃣.2 Random Number

The Client generates 32 bytes of random data, which will help create unique session keys. This element adds necessary “entropy” to the encryption process.

1️⃣.3 Session ID

This optional feature allows the Client and Server to resume a previous session, which simplifies the handshake process. For our purposes, we will illustrate a complete handshake, not utilizing session resumption.

1️⃣.4 Cipher Suites

A Cipher Suite defines the algorithms used for authentication, key exchange, symmetric encryption, and hashing. The Client sends a list of supported Cipher Suites, expecting the Server to select an option from it.

1️⃣.5 Extensions

Extensions add new features and capabilities to the TLS protocol without requiring a complete rewrite. For simplicity’s sake, we will assume no extensions are used in this demonstration, although many are commonplace in modern TLS

Share this content:

Leave a Reply

Your email address will not be published. Required fields are marked *