What is tls handshake

Last updated: April 1, 2026

Quick Answer: A TLS handshake is the initial negotiation process between a client and server that establishes a secure connection before transmitting data. It authenticates both parties, agrees on encryption methods, and generates the shared secret key used for all encrypted communications.

Key Facts

What is the TLS Handshake?

The TLS handshake is the initial negotiation process between a client and a server that establishes a secure connection before any data is transmitted. It's a critical security mechanism that authenticates the server (and optionally the client), agrees on encryption methods, and generates the shared secret key that encrypts all subsequent communications. Without the handshake, secure communication would be impossible—it's the foundation of all HTTPS connections, secure emails, and encrypted communications across the internet.

The TLS 1.2 Handshake Process

The TLS 1.2 handshake typically involves the following steps:

This process typically requires two round-trips of communication between the client and server, adding latency to connection establishment.

The TLS 1.3 Handshake

TLS 1.3 streamlined this process significantly. The main improvements include reducing the handshake to just one round-trip in typical scenarios. The client can now send its key share in the initial ClientHello message, and the server can immediately respond with its selection and key share. This enables the "0-RTT" (zero round-trip time) feature in specific cases, where clients can send encrypted data even before the handshake is fully complete. These changes make TLS 1.3 approximately 25% faster than TLS 1.2 for connection establishment.

Certificate Verification

During the handshake, the server presents a digital certificate to authenticate its identity. The client verifies this certificate by checking that it was signed by a trusted certificate authority (CA). This verification ensures the client is communicating with the legitimate server and not an imposter. Certificate authorities maintain hierarchies of trust, allowing clients to verify any certificate by tracing it back to a root certificate authority they already trust. Public key cryptography enables this authentication mechanism—the CA's private key signs the certificate, and anyone can verify it with the CA's public key.

Security Implications

The TLS handshake is essential for preventing man-in-the-middle attacks, where an attacker intercepts communications between two parties. By verifying the server's certificate, clients can ensure they're communicating with the genuine server. The key exchange during the handshake establishes a shared secret that only the client and server know, making it impossible for eavesdroppers to decrypt subsequent communications. The handshake also provides forward secrecy in modern implementations, meaning that compromising a server's long-term private key doesn't compromise past sessions encrypted with session-specific keys generated during the handshake.

Related Questions

Why does the TLS handshake take multiple round-trips?

TLS 1.2 requires multiple round-trips because the client and server need to exchange multiple messages to authenticate each other, negotiate security parameters, and establish a shared key. TLS 1.3 optimized this by allowing key exchange information in the initial messages.

What happens if the TLS handshake fails?

If the handshake fails—typically due to certificate verification issues, unsupported cipher suites, or version mismatches—the connection is not established. The browser displays a security warning, and no data is transmitted. This protection prevents insecure connections.

How long does a TLS handshake take?

A typical TLS 1.2 handshake takes 100-300 milliseconds depending on network latency and server response time. TLS 1.3 reduces this to 50-150 milliseconds. For subsequent connections, session resumption can reduce handshake overhead significantly.

Sources

  1. Wikipedia - Transport Layer Security CC-BY-SA-4.0
  2. IETF RFC 8446 - TLS 1.3 Specification IETF
  3. Cloudflare - TLS 1.3 Overview CC-BY-4.0