TechnologyNetworking

How the TLS handshake works, from ClientHello to encrypted data

A step-by-step explanation of the TLS 1.3 handshake: key exchange, certificate verification, cipher suites, session resumption and why the number of round trips decides how fast a secure connection feels.

MAMichael Adeyemi — Senior Technology Writer, MSc, Distributed SystemsPublished 2 April 2026Last reviewed 28 July 202610 min readIntermediate1,964 words

Fact-checked by Dr. Rina Halvorsen, Editor-in-Chief (PhD, Cognitive Science) · 3 primary sources cited · how we review

Engraved illustration of two servers exchanging a handshake secured by a brass padlock

In short

The TLS handshake is the negotiation that turns an open TCP connection into an encrypted, authenticated channel. It agrees on a cipher suite, proves the server's identity with a certificate chain, and derives shared keys without ever sending them across the wire. TLS 1.3 compresses that work into a single round trip, and resumption can remove even that.

When a browser shows a padlock, it is reporting the outcome of a short but dense conversation that happened before any page content moved. That conversation is the TLS handshake. It has three jobs: agree on the cryptography both sides will use, prove that the server is genuinely the owner of the hostname requested, and establish a shared secret that an eavesdropper cannot reconstruct even with a full recording of the exchange.

Those three jobs sound separable but are deliberately interlocked. The identity proof is bound to the key exchange, so an attacker who intercepts the traffic cannot substitute their own keys while replaying the real server's certificate. Understanding that binding is the difference between treating HTTPS as a checkbox and understanding what it actually guarantees.

What happens before the handshake

TLS runs on top of a transport connection, so the clock starts earlier than most people assume. A cold request to a new origin needs a DNS lookup, then a TCP connection (one round trip for the SYN/SYN-ACK exchange), and only then can the handshake begin. On a mobile network with a 70 ms round-trip time, those preliminaries alone can cost 140 ms before a single cryptographic byte is exchanged.

This is why the handshake's round-trip count matters so much. Cryptographic computation on modern hardware is measured in microseconds; the latency comes almost entirely from waiting for packets to cross the network and return.

The TLS 1.3 handshake, step by step

1. ClientHello

The client opens with a message listing the TLS versions it supports, the cipher suites it will accept, the named groups it can use for key exchange, and — crucially in TLS 1.3 — a key share: one or more ephemeral public keys generated for this connection only. It also sends the Server Name Indication extension so that a server hosting many domains on one address knows which certificate to present.

Sending the key share optimistically is the single change that made TLS 1.3 a one-round-trip protocol. In TLS 1.2 the client had to wait to learn which group the server preferred before it could contribute its half of the exchange.

2. ServerHello and the encrypted extensions

The server picks a cipher suite and a group, returns its own ephemeral key share, and from that point everything else in the handshake is already encrypted. Both sides can now perform the Diffie-Hellman computation and derive identical handshake secrets. The server's certificate chain, its signature over the handshake transcript and any extension data all travel under that encryption.

3. Certificate and verification

The server presents a chain: its leaf certificate, plus the intermediate certificates that link it to a root the client already trusts. The client checks that the hostname matches, that the validity dates cover the present moment, that no certificate in the chain has been revoked, and that each signature verifies against the next certificate up. Finally the server signs a hash of the entire handshake transcript with the private key corresponding to the leaf certificate. That signature is what binds identity to this specific key exchange.

4. Finished

Both sides send a Finished message containing a MAC over everything exchanged. If either side's view of the transcript differs — because a middlebox altered a message, or a downgrade was attempted — the MACs disagree and the connection aborts. Application data can then flow under the derived traffic keys.

Round trips before the first byte of application data
ScenarioRound trips after TCPTypical added latency at 70 ms RTT
TLS 1.2, full handshake2~140 ms
TLS 1.3, full handshake1~70 ms
TLS 1.3, session resumption (PSK)1~70 ms
TLS 1.3, 0-RTT early data0~0 ms, with replay caveats

Handshake latency by TLS configuration

Milliseconds before application data, 70 ms RTT link

Figures assume TCP is already established and exclude DNS. Values scale linearly with round-trip time, so the gap widens on high-latency mobile and satellite links.

Cipher suites and what they actually name

A TLS 1.2 cipher suite string named four things at once: the key exchange, the authentication algorithm, the bulk cipher and the MAC. TLS 1.3 stripped that down. A suite such as TLS_AES_128_GCM_SHA256 names only the authenticated encryption algorithm and the hash used in key derivation; key exchange and signature algorithms are negotiated separately through extensions. The practical effect is that the entire catalogue of weak and legacy combinations was removed rather than merely deprecated.

  • Key exchange in TLS 1.3 is always ephemeral, so recording traffic today and stealing the server key later does not decrypt it — the property known as forward secrecy.
  • Static RSA key transport, compression, renegotiation and non-AEAD ciphers were all removed rather than made optional.
  • Signature algorithms are negotiated independently, which lets a server rotate from RSA to ECDSA certificates without changing its suite list.

Session resumption and 0-RTT

After a successful handshake a server can issue a session ticket: an encrypted blob the client stores and presents on a later connection as a pre-shared key. Resumption skips certificate verification and the associated signature, which saves computation, but it still costs one round trip before application data unless 0-RTT early data is used.

0-RTT early data

Pros

  • Removes the last round trip, so a repeat visitor's first request leaves with the handshake
  • Especially valuable on high-latency mobile links where each round trip is 100 ms or more
  • Requires no change to page content or application logic for simple GET traffic

Cons

  • Early data can be replayed by an attacker who captures it, so it must be restricted to idempotent requests
  • Does not have forward secrecy against compromise of the resumption key until the handshake completes
  • Adds server-side state or ticket-key management that must be rotated on a schedule

Where handshakes go wrong in practice

The most common production failure is not cryptographic at all: it is an incomplete chain. A server that sends only its leaf certificate will work in browsers that happen to have cached the intermediate and fail in clients that have not. Because the failure is intermittent and client-dependent, it often survives internal testing and appears only in support tickets.

  1. Serve the full chain: leaf plus every intermediate, excluding the root, in order.
  2. Monitor expiry with alerting at 30 and 7 days, not with a calendar reminder.
  3. Keep clocks synchronised — a server whose clock has drifted past the certificate's notBefore date will reject valid handshakes.
  4. Enable OCSP stapling so clients do not make a separate blocking request to the certificate authority.
  5. Test with a client that has an empty trust cache to catch missing intermediates.

Key points

  • TLS 1.3 completes a full handshake in one round trip by having the client send a key share optimistically.
  • The server's signature covers the whole handshake transcript, binding its identity to this specific key exchange.
  • Ephemeral key exchange gives forward secrecy: a stolen server key does not decrypt recorded past sessions.
  • Resumption saves computation; only 0-RTT saves a round trip, and it carries replay risk.
  • Most real-world handshake failures are certificate chain or clock problems, not cryptographic weaknesses.

What TLS 1.3 removed, and why it mattered

TLS 1.3, standardised in RFC 8446 in 2018, is not simply a faster version of TLS 1.2; a substantial share of the specification is dedicated to deleting options rather than adding them. Static RSA key exchange, in which the client encrypted a secret directly with the server's long-term public key, was removed entirely, because it provides no forward secrecy — anyone who later obtains the server's private key, whether through compromise or legal compulsion, can decrypt every past session ever recorded. Renegotiation, compression at the record layer, and every non-authenticated-encryption cipher were likewise removed outright rather than merely discouraged, closing off entire categories of past vulnerabilities, including the CRIME and BREACH compression side-channel attacks and the Logjam and FREAK downgrade attacks, by making the vulnerable configurations impossible to negotiate rather than relying on server operators to disable them correctly.

Certificate transparency and the limits of the certificate authority model

The handshake's identity check is only as trustworthy as the certificate authority system behind it, and that system has a structural weakness: any of the roughly one hundred certificate authorities trusted by a typical browser could, through compromise or error, issue a valid certificate for a domain they do not actually control. Certificate Transparency, developed initially at Google and now effectively mandatory for publicly trusted certificates in major browsers, addresses this by requiring every issued certificate to be logged in public, append-only logs that anyone can monitor, so a domain owner can detect an unauthorised certificate issued for their name even if the certificate authority itself never notices its own mistake. This does not prevent a bad certificate from being issued, but it converts an invisible failure into a publicly auditable one, which has led to the detection of several real misissuance incidents that would previously have gone unnoticed.

TLS inside QUIC and HTTP/3

HTTP/3 runs over QUIC, a transport protocol that integrates the TLS 1.3 handshake directly into its own connection setup rather than layering TLS on top of an already-established TCP connection. This integration is where a further latency gain comes from: QUIC's connection establishment and the TLS handshake occur as a single combined exchange, rather than TCP's setup completing first and TLS's setup only starting afterwards, which removes one of the two round trips that a fresh HTTPS-over-TCP connection otherwise requires. QUIC also carries connections through network changes more gracefully — a phone moving from Wi-Fi to mobile data can keep an existing connection alive because QUIC identifies connections by a connection ID rather than by the IP address and port tuple that TCP relies on, a property with no direct analogue in the classic TLS-over-TCP handshake described earlier in this article.

The coming transition to post-quantum key exchange

A newer concern reshaping TLS deployment is the eventual threat that a sufficiently capable quantum computer could break the elliptic-curve and finite-field Diffie-Hellman key exchanges that TLS 1.3 currently relies on for its ephemeral key shares. Because traffic recorded today could in principle be decrypted retroactively once such a computer exists — a scenario often called 'harvest now, decrypt later' — major browsers and cloud providers have already begun deploying hybrid key exchange, which combines a traditional elliptic-curve key share with a post-quantum candidate such as ML-KEM (standardised by NIST in 2024) in the same ClientHello, so that breaking either algorithm alone is insufficient to recover the shared secret. This is being rolled out as a pure extension to the existing TLS 1.3 handshake structure described earlier, requiring no change to the overall message flow, only to the content of the key share extension itself.

TLS 1.2 versus TLS 1.3: what changed
PropertyTLS 1.2TLS 1.3
Full handshake round trips21
Static RSA key exchangePermittedRemoved entirely
Forward secrecyOptional, cipher-suite dependentMandatory for every connection
Compression at record layerPermitted (enabled the CRIME attack)Removed entirely
Cipher suite namingNames key exchange, auth, cipher and MAC togetherNames only the authenticated encryption algorithm and hash

Sponsored video

Advertisement

Checking for a video ad…

Frequently asked questions

Sources

About the author

Michael Adeyemi — Senior Technology Writer

Michael writes Inquro's computing and web-infrastructure coverage. He worked for eight years as a platform engineer on high-traffic content systems before moving into full-time technical explanation, and he still prototypes every measurement described in his articles before publishing the numbers.

Qualifications
  • MSc, Distributed Systems — University of Manchester
  • BEng, Computer Engineering — University of Lagos
Experience
  • Eight years as a platform engineer on high-traffic content delivery systems
  • Four years writing standards-based technical documentation
Subject areas:
Web performance, Networking, Systems architecture

Reviewed for factual accuracy by Dr. Rina Halvorsen, Editor-in-Chief (PhD, Cognitive Science), on 28 July 2026.

Structure, claim strength and whether an explanation actually answers the question a reader arrived with.

Inquro articles are commissioned, sourced, reviewed and re-checked under a published editorial policy. Corrections are made in place and dated — write to editorial@inquro.example if you find an error.

Related explainers

More from Technology and connected clusters across the full library.

TechnologyNetworking

How DNS resolution works, step by step

A complete walkthrough of DNS resolution: the recursive resolver, root, TLD and authoritative servers, caching layers, TTL behaviour, and why DNS is so often the hidden cause of slow first loads.

Michael AdeyemiUpdated 15 July 202611 min
TechnologyWeb Performance

Core Web Vitals explained: what LCP, INP and CLS actually measure

A practitioner's guide to Core Web Vitals: what Largest Contentful Paint, Interaction to Next Paint and Cumulative Layout Shift measure, how field data differs from lab data, and how to diagnose each metric.

Michael AdeyemiUpdated 28 July 202611 min
TechnologyNetworking

What actually happens between pressing Enter and seeing a page

A complete walk-through of the pipeline behind a single web request: DNS resolution, TCP and TLS setup, the HTTP exchange, and browser parsing and rendering, with the latency each stage typically adds.

Michael AdeyemiUpdated 14 February 20269 min
TechnologyNetworking

How public key infrastructure turns a key pair into verifiable identity

How public key infrastructure links cryptographic keys to real-world identity through certificates, certificate authorities and trust chains, and how revocation, transparency logs and automation keep the system trustworthy at internet scale.

Michael AdeyemiUpdated 11 April 20269 min

Keep reading

Definitions used here

Go deeper