Security & SSL

TLS Handshake: What It Is and How a Secure HTTPS Connection Is Made

The TLS handshake is the initial negotiation process that happens when you connect to an HTTPS site, where client and server agree on encryption parameters before exchanging a single byte of application data.

Hand holding a brass padlock, symbolizing security and protection

The TLS handshake is the automatic negotiation that happens in milliseconds every time a browser connects to an HTTPS site. In those milliseconds, client and server agree on which encryption algorithms to use, verify the server's identity via its certificate, and exchange the keys that will protect the entire session.

Why Does the TLS Handshake Exist?

HTTP sends data in plain text: anyone who intercepts the traffic can read it. TLS (Transport Layer Security) fixes this by adding an encryption layer between the transport layer (TCP) and the application (HTTP). But to encrypt, the two sides must first agree on how to encrypt. That agreement is the handshake.

The handshake solves three problems at once:

  • Authentication: the client verifies it's talking to the legitimate server, not an impersonator.
  • Algorithm negotiation: both parties agree on the cipher suite they'll use.
  • Key exchange: a shared session key is derived without that key ever traveling across the network.

TLS 1.2 vs TLS 1.3: Two Ways to Handshake

There are two active versions of TLS, and their handshakes differ in important ways:

Feature TLS 1.2 TLS 1.3
Round trips (RTT) 2 1 (or 0 with 0-RTT)
Published 2008 2018
Weak cipher suites allowed Yes No (removed)
Forward Secrecy mandatory No Yes
Handshake latency Higher Lower

TLS 1.3 is the current standard. If your server still uses TLS 1.0 or 1.1, those versions are officially deprecated (RFC 8996) and you should migrate.

The TLS 1.3 Handshake Step by Step

TLS 1.3 simplified the handshake compared to 1.2. Here's the complete flow:

Step 1 — ClientHello

The browser sends the server:

  • The TLS versions it supports.
  • The available cipher suites (e.g., TLS_AES_256_GCM_SHA384).
  • An ephemeral public key (via a key agreement algorithm, usually X25519 or P-256).
  • A random number (client random).

Step 2 — ServerHello + Certificate + Finished

The server responds in a single flight:

  • Selects the cipher suite and TLS version.
  • Sends its own ephemeral public key.
  • Sends its SSL certificate (containing its static public key).
  • Sends a Finished message already encrypted with the derived session key.

At this point the server can compute the session key by combining its ephemeral private key with the client's public key. The client does the same. No private key ever crossed the wire.

Step 3 — Certificate Verification

The client validates the server's certificate:

  • Verifies the signature comes from a trusted CA.
  • Checks that the certificate's domain matches the one being visited.
  • Confirms the certificate hasn't expired or been revoked (OCSP).

Step 4 — Client Finished

The client sends its own encrypted Finished message. From this point on, all communication is protected by the derived session key. The handshake is complete in 1 RTT (one round trip).

What Is 0-RTT in TLS 1.3?

TLS 1.3 introduces an optional mode called 0-RTT (Zero Round Trip Time Resumption). If the client has talked to that server before, it can send application data in the very first message, without waiting for the server's response.

Advantage: minimal latency on reconnections. Disadvantage: 0-RTT data is vulnerable to replay attacks. That's why 0-RTT should only be used for idempotent requests (like GET), never for POST requests with sensitive data.

How the TLS Handshake Affects Your Site's Performance

The handshake adds latency. In TLS 1.3 the penalty is minimal (1 extra RTT before the first byte), but in TLS 1.2 it was 2 RTTs. For a user in Latin America connecting to a server in Europe, that can mean 300–400 ms of additional delay on the first connection.

Strategies to minimize the impact:

  • TLS 1.3: migrate if you haven't already.
  • Session resumption: reuse parameters from previous sessions on the same or subsequent connections.
  • HTTP/2 and HTTP/3: multiplex multiple requests over a single TLS connection, spreading the handshake cost across many requests.
  • Servers closer to your users: a CDN reduces physical RTT.

To dive deeper into how certificate type and TLS configuration affect your site's overall security posture, check out our SSL security guides.

Key Takeaways

  • The TLS handshake negotiates encryption, authenticates the server, and derives the session key before any application data flows.
  • TLS 1.3 completes the handshake in 1 RTT (vs. 2 in TLS 1.2), with stronger security and no weak cipher suites.
  • Ephemeral key exchange (Diffie-Hellman) ensures that even if someone captures today's traffic and later obtains the server's private key, they still can't decrypt past sessions (Forward Secrecy).
  • 0-RTT improves latency on reconnections but is only safe for idempotent requests.
  • HTTP/2 and a good CDN minimize the perceived performance impact of the handshake.

Is your site already running TLS 1.3 with the right cipher suites? The team at elenlace.com can audit and optimize your server's SSL/TLS configuration to maximize both security and speed.

FAQ

Does the TLS handshake happen on every HTTP request?

No. The handshake happens once per TCP connection. HTTP/2 and HTTP/3 keep the connection open and multiplex multiple requests over it, so the handshake cost is spread across all requests in the same browsing session.

What is a cipher suite in TLS?

A cipher suite is a set of algorithms that defines how key exchange, data encryption, and integrity verification will be performed. An example in TLS 1.3: TLS_AES_128_GCM_SHA256, which uses AES-128-GCM for encryption and SHA-256 for integrity. TLS 1.3 trimmed the list to just five cipher suites, all of them secure.

What does it mean that TLS guarantees Forward Secrecy?

Forward Secrecy (or Perfect Forward Secrecy, PFS) means the session key is ephemeral: it's generated for each session and discarded when the session ends. Even if an attacker records today's encrypted traffic and later obtains the server's private key, they still won't be able to decrypt those past sessions because the keys no longer exist.

How do I check which TLS version my site is using?

You can check with online tools like SSL Labs (ssllabs.com/ssltest) or from the command line with openssl s_client -connect yourdomain.com:443 -tls1_3. A good result will show TLS 1.3 with no support for versions 1.0 or 1.1.

Prefer it done for you? El Enlace handles hosting and professional web development.

Useful resources

Other providers and guides worth comparing:

← All