Reference guide · dns-ssl · Published 2026-08-15 · 3 min read

How the SSL and TLS handshake works

How the SSL and TLS handshake works, step by step, from ClientHello to finished messages, cipher suites, certificates and TLS 1.3.

Flat editorial illustration showing a globe of orbiting nodes resolving into a key and shield form, dotted resolution paths converging.
Illustration: this article at a glance.

Overview

The SSL and TLS handshake is the conversation a browser and a server have before any encrypted data moves. It does three jobs in one trip: agree on which protocol version to use, verify that the server is who it claims to be, and agree on a shared secret without ever sending that secret across the wire. Nearly every "your connection is not private" error, handshake timeout, and cipher mismatch is a failure of one of these three jobs.

The steps in order

  1. The client sends a ClientHello: supported TLS versions, cipher suites, and a random number for later key derivation.
  2. The server replies with a ServerHello choosing one version and one cipher suite, sends its random, and presents its certificate chain.
  3. The client checks the certificate: validity dates, hostname in the SAN list, signature from a CA the client trusts.
  4. If the certificate is valid, the two sides run a key exchange to agree the same session key without transmitting it. In RSA suites the client encrypts a pre-master secret with the public key; in Diffie-Hellman suites both sides contribute and the result is forward secret.
  5. Each side sends Finished messages, a hash of everything agreed so far, and encrypted application data can now flow.

What a cipher suite string says

Cipher suite names look intimidating but split into fields. For ECDHE-RSA-AES128-GCM-SHA256, the parts mean:

| Field | Example value | Role |

| ECDHE | ECDHE | Ephemeral elliptic-curve Diffie-Hellman key exchange, forward secret |

| RSA | RSA | Algorithm that signs authentication during key exchange |

| AES128-GCM | AES-128 with GCM | Symmetric block cipher and mode that encrypts the data |

| SHA256 | SHA-256 | Hash function used in the message authentication code |

"No shared cipher" is the browser equivalent of two people who cannot agree on a language. When you see it, the fix is usually on the server: re-enable an older cipher, or remove unnecessary TLS versions.

Differences in TLS 1.3

TLS 1.3 changes the handshake from a two-round-trip to a one-round-trip process for a new connection:

In practice

In the browser you can watch a handshake fail: curl -v https://example.com prints the ClientHello, the ServerHello, the certificate, and the negotiated TLS version and cipher, then "subject: CN=...". If the check fails, the output also names the reason; SSL certificate problem for trust failures, no peer certificate available when nothing is presented, and handshake failure usually for cipher by a version mismatch. Shared error references live in the SSL errors article, and certificate type differences live in the certificate types article.

Prevention

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services