Network security

TLS Handshake Explained: How TLS 1.3 Works Step by Step

Every HTTPS connection starts with a TLS handshake — a short negotiation that proves the server is who it claims to be and agrees on encryption keys before any data moves.

Cysoro Security TeamPublished · 9 min read
Client Server NETWORK SECURITY TLShandshake One round trip. Then encrypted.
Quick answer

A TLS handshake is the opening negotiation of a TLS connection, in which a client and server agree on a TLS version and cipher suite, the server proves its identity with a certificate, and both sides derive shared session keys. In TLS 1.3 the handshake takes one round trip, and everything after the ServerHello message is encrypted.

Key takeaways

  • The TLS handshake agrees on a version and cipher suite, authenticates the server, and creates fresh session keys before any application data is sent.
  • TLS 1.3 completes the handshake in one round trip and encrypts the certificate and later messages, unlike TLS 1.2 which needed two round trips.
  • Most handshake failures come from expired or mismatched certificates, outdated TLS versions, or a cipher suite the two sides do not share.

Every time you open a website over HTTPS, your browser and the server run a short negotiation before a single byte of page content moves. That negotiation is the TLS handshake, and it does three jobs at once: it agrees on how to encrypt the connection, proves the server is who it claims to be, and creates fresh keys that only the two sides know.

What is a TLS handshake?

A TLS handshake is the opening exchange of a TLS connection, in which a client and a server agree on a TLS version and cipher suite, the server proves its identity with a certificate, and both sides derive shared session keys for encrypting everything that follows.

TLS stands for Transport Layer Security. It is the protocol behind the padlock in your browser and behind HTTPS. Its predecessor, SSL (Secure Sockets Layer), was replaced years ago, but the term "SSL handshake" still survives in error messages and older documentation. When a browser says it is doing an SSL handshake, it almost always means a TLS handshake.

The handshake happens after the TCP connection is established, and before any HTTP request is sent. If the handshake fails, the browser shows an error and no page data is exchanged. That fail-closed behavior is deliberate: it is better to show an error than to send a password or card number over a connection that could not be verified.

Cloudflare's TLS documentation describes the handshake as the process that kicks off a TLS session, during which the two sides exchange messages to acknowledge each other, verify each other, establish the cryptographic algorithms they will use, and agree on session keys. The full specification is RFC 8446, which defines TLS 1.3.

What does the TLS handshake actually do?

The handshake delivers three guarantees that TLS is built around: encryption, authentication, and integrity. Encryption hides the data from anyone watching the network, authentication proves the server is the real site, and integrity lets each side detect tampering.

  • Encryption: the two sides agree on session keys so that all later traffic is encrypted with symmetric cryptography, which is fast enough for real-time use.
  • Authentication: the server presents a certificate signed by a trusted certificate authority, and the client checks that signature, the domain name, and the expiry date.
  • Integrity: every handshake message is covered by a transcript hash, so tampering with an earlier message is detected when the Finished messages are checked.
  • Forward secrecy: in TLS 1.3 the keys are derived from an ephemeral Diffie-Hellman exchange, so a stolen server key cannot decrypt past sessions.

Notice what the handshake does not do. It does not encrypt the very first message, and it does not normally authenticate the client. Client certificates exist, but most websites authenticate users later, with a password or passkey, after the encrypted channel is up.

How does the TLS 1.3 handshake work step by step?

In TLS 1.3 the normal handshake takes one round trip. The client guesses which key-exchange group the server will pick and sends a key share in its first message, so the server can answer with keys immediately instead of asking for another round.

TLS 1.3 handshake: one round trip1. ClientHelloversions, ciphers, key share2. ServerHellochosen cipher, key share3. Certificate + Finishedencrypted, proves server identity4. Client Finishedconfirms the transcript hash5. Encrypted application dataHTTP requests and responses, protected by session keys
The TLS 1.3 handshake in five steps. Illustration by Cysoro.

Step 1: ClientHello

The client sends a ClientHello message. It lists the TLS versions it supports, the cipher suites it can use, a 32-byte random value, and the server name it wants to reach (the SNI extension). Crucially, it also includes a key share: its public value for the Diffie-Hellman group it expects the server to choose.

That guess is what makes TLS 1.3 fast. If the server accepts the guessed group, it can derive the shared secret immediately. If it does not, it replies with a HelloRetryRequest naming a different group, and the handshake costs an extra round trip.

Step 2: ServerHello

The server replies with a ServerHello. It picks one TLS version and one cipher suite, sends its own random value and its own key share, and from this point on everything is encrypted. Both sides now compute the same shared secret from the two key shares, without ever sending the secret itself across the network.

Step 3: EncryptedExtensions, Certificate, CertificateVerify, Finished

The server then sends its certificate chain, encrypted under the new handshake keys, along with a CertificateVerify message that proves it holds the private key matching the certificate. It finishes with a Finished message containing a hash of the entire handshake so far.

Encrypting the certificate was a major change from TLS 1.2, where the certificate travelled in the clear and revealed which site a visitor was reaching. The client checks the certificate chain, the domain name, and the expiry date before trusting it.

Step 4: Client Finished

The client sends its own Finished message, also covered by the transcript hash. Once the server verifies it, the handshake is complete and both sides switch to application traffic keys. The first HTTP request can then travel inside the encrypted channel.

How is the TLS 1.3 handshake different from TLS 1.2?

TLS 1.3 cut the handshake from two round trips to one, made forward secrecy mandatory, and encrypted everything after ServerHello. TLS 1.2 sent the certificate in the clear and allowed older, weaker options that TLS 1.3 removed entirely.

FeatureTLS 1.2TLS 1.3
Round trips21 (0 with session resumption)
CertificateSent in the clearEncrypted
Forward secrecyOptionalMandatory for all connections
Key exchangeRSA, static Diffie-Hellman allowedEphemeral Diffie-Hellman only
Cipher suitesMany, including weak onesFive AEAD suites only
Legacy algorithmsSHA-1, MD5, RC4, compressionRemoved
StandardRFC 5246 (2008)RFC 8446 (August 2018)

TLS 1.3 also removed renegotiation and simplified the cipher suite list to authenticated encryption with associated data (AEAD) suites such as TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, and TLS_CHACHA20_POLY1305_SHA256. Fewer choices means fewer ways to misconfigure a server.

TLS 1.0 and 1.1 were formally deprecated by RFC 8996 in March 2021. NIST SP 800-52 Rev. 2 recommends that servers support TLS 1.2 at minimum and prefer TLS 1.3. If your server still negotiates TLS 1.0 or 1.1, that is a finding, not a compatibility feature.

What can an observer still see during a TLS handshake?

Even in TLS 1.3, the ClientHello is sent in the clear, so a network observer can see the server name in the SNI extension, the offered cipher suites, and the timing and size of the exchange. The content, URLs, and cookies are encrypted.

That visibility matters on public Wi-Fi and on networks that inspect traffic. SNI reveals which site you are visiting, even though it does not reveal which page. Encrypted Client Hello (ECH), defined in a later draft and now being deployed, encrypts that field too, but it is not yet universal, so do not assume the destination is hidden.

For a small business, the practical point is simple: TLS protects the contents of a connection, not the fact that the connection happened. If you need to hide the destination itself, that is a job for a VPN or Tor, not for TLS alone. Our guide to securing your Wi-Fi covers the network side of the same problem.

What is session resumption and 0-RTT?

Session resumption lets a returning client skip part of the handshake by presenting a ticket or pre-shared key from an earlier session. In TLS 1.3 the client can even send application data in its first message, a mode called 0-RTT, or zero round-trip time.

0-RTT saves a round trip, which matters on slow mobile networks, but it has a real security trade-off. The early data is sent before the server has contributed a fresh random value, so an attacker who captures it can replay the same bytes later. RFC 8446 is explicit that early data has no guarantee of non-replay between connections.

That is why 0-RTT should only carry requests that are safe to run twice, such as a GET for a static page. A payment, a password change, or any request that changes state should never be sent as early data. Servers that are unsure should reject early data and ask the client to retry after the handshake, using the HTTP 425 Too Early status.

Why does a TLS handshake fail?

Most handshake failures fall into four buckets: a bad certificate, a version or cipher mismatch, a broken chain, or something in the middle interfering. The browser error usually hints at which one you are facing.

Four common handshake failuresExpired certificateThe certificate passed its notAfter date.Fix: renew it and automate renewal.Wrong domain nameCertificate is for another hostname.Fix: issue a certificate covering the name.Old TLS version onlyServer offers only TLS 1.0 or 1.1.Fix: enable TLS 1.2 and 1.3, disable old versions.No shared cipher suiteClient and server share no cipher.Fix: enable a standard AEAD suite.
Diagnose a handshake failure by checking the certificate first, then the TLS version and cipher list. Illustration by Cysoro.
  • Expired certificate: certificates now last at most 398 days, and many are 90 days. Automate renewal with ACME, and monitor expiry so a lapsed certificate never takes a site down.
  • Name mismatch: the certificate must cover the exact hostname the visitor typed, including any subdomain. A certificate for example.com does not cover shop.example.com unless it is listed.
  • Version mismatch: an old client that only speaks TLS 1.0 cannot talk to a server that requires TLS 1.2 or higher, and vice versa. Update the client or the server, do not lower the server.
  • No shared cipher suite: if the two sides have no cipher in common, the handshake aborts. Enable at least one standard AEAD suite on the server.
  • Interference: some corporate proxies, antivirus tools, and captive portals intercept TLS. If a site works on one network and fails on another, test from a different network before blaming the certificate.

Check your own site regularly with the free SSL checker. It shows the certificate chain, expiry date, and supported TLS versions in seconds, and it catches the expiry problem before your visitors do.

How do you check and fix a TLS handshake?

Start from the browser, then move to a server-side check. The browser padlock shows the certificate, the TLS version, and the cipher suite for the current connection, which is enough to confirm whether the handshake succeeded and which version was negotiated.

  1. Open the padlock: click it and read the certificate details, the issuer, and the expiry date.
  2. Run an SSL check: test the domain with a checker that lists the full chain, all supported versions, and any weak ciphers.
  3. Fix the chain: serve the intermediate certificates as well as the leaf certificate, in the right order.
  4. Enable TLS 1.3: most modern servers support it with a configuration change, and it is the fastest and most secure option.
  5. Disable TLS 1.0 and 1.1: they are deprecated and add risk for no real compatibility benefit in 2026.
  6. Set up expiry alerts: monitor every certificate and alert at 30, 14, and 7 days before expiry.

If you run a small business site, the small business cybersecurity checklist puts certificate monitoring alongside backups, updates, and MFA, so one missed renewal does not become an outage.

The bottom line

The TLS handshake is a short, carefully designed negotiation: agree on the rules, prove the server, then create fresh keys and encrypt everything after. TLS 1.3 does it in one round trip, encrypts the certificate, and makes forward secrecy mandatory.

When it breaks, the cause is usually ordinary: an expired certificate, a wrong hostname, or an outdated server. Keep certificates renewed automatically, support TLS 1.2 and 1.3 only, and check your site with the free SSL checker before your visitors find the problem for you.

Frequently asked questions

What is a TLS handshake in simple terms?

It is the short conversation a browser and a website have before sending any real data. They agree on how to encrypt the connection, the website proves who it is with a certificate, and both sides create temporary keys. Only then does the page, login or payment data travel.

How many steps are in a TLS 1.3 handshake?

In the normal case there are three flights of messages: the client sends a ClientHello with a key share, the server replies with ServerHello, its certificate and a Finished message, and the client replies with its own Finished message. That is one round trip before application data can flow.

What is the difference between a TLS handshake and an SSL handshake?

SSL is the older protocol that TLS replaced. People still say SSL handshake out of habit, but modern connections use TLS, usually TLS 1.2 or 1.3. SSL versions 2 and 3 are insecure and should be disabled everywhere.

What happens if the TLS handshake fails?

The browser shows an error such as ERR_SSL_PROTOCOL_ERROR or a certificate warning, and no page data is sent. Common causes are an expired or wrong-name certificate, a server that only supports old TLS versions, or a firewall or proxy that blocks the negotiation.

Is the TLS handshake encrypted?

In TLS 1.3, everything after the ServerHello message is encrypted, including the server certificate. The first ClientHello is sent in the clear, so the server name in the SNI extension can still be visible to anyone watching the network.

What is 0-RTT in TLS 1.3?

0-RTT lets a client send application data in its very first message when resuming an earlier session, using a pre-shared key. It saves a round trip but the early data can be replayed by an attacker, so it should only be used for requests that are safe to run twice.

Does a TLS handshake happen on every page load?

A full handshake happens when a new TLS connection is opened, which is often once per site visit. Returning visits can resume a previous session with a shorter handshake, and HTTP/2 and HTTP/3 connections are usually reused for many requests.

How can I check a site's TLS handshake and certificate?

Open the padlock icon in your browser to see the certificate, the TLS version and the cipher suite. For a deeper check, run the site through a free SSL checker to see the certificate chain, expiry date and supported TLS versions.

Sources

  1. IETF — RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
  2. Cloudflare — What happens in a TLS handshake?
  3. Cloudflare — What is Transport Layer Security (TLS)?
  4. Mozilla — Transport Layer Security (TLS)
  5. NIST — SP 800-52 Rev. 2, Guidelines for the Selection, Configuration, and Use of TLS
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 8446, Cloudflare's TLS handshake documentation and NIST SP 800-52 Rev. 2.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free