TLS 1.3 — Inside the Handshake, Byte by Byte

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 27, 2026
10 min read
Read as

Last updated: May 1, 2026

100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

TLS 1.3 (RFC 8446) is the modern transport-security protocol every browser, API, and increasingly every database now speaks. Compared to TLS 1.2 it cuts handshake round-trips, removes broken cryptography, and provides forward secrecy by default. This module walks the handshake — Client Hello, Server Hello, key share, certificate, finished — explains what each extension does, why 0-RTT is dangerous, what ECH does to SNI privacy, and how to read TLS in Wireshark even without keys.

You can build a working understanding of TLS 1.3 in an afternoon if you focus on the right things: the four messages of the handshake, the eight or so extensions that matter, and the failure modes you are going to see in production. This module gives you that understanding. By the end you can explain TLS to an auditor, debug a handshake failure from a Wireshark capture, and confidently choose cipher suites and certificate-validation policies.

Why TLS 1.3 exists — what was wrong with 1.2

TLS 1.2 (2008) accumulated 17 years of patches and supports cryptographic primitives nobody should use anymore (RSA key exchange without forward secrecy, CBC mode ciphers vulnerable to padding-oracle attacks, MD5/SHA-1 in many places). The handshake takes 2 round-trips before encrypted data flows. The cipher-suite list is enormous (hundreds of permutations) — most insecure, all advertised. TLS 1.3 (RFC 8446, 2018) deleted everything broken: only AEAD ciphers, only ephemeral key exchange, only modern signatures. The handshake is one round-trip in the typical case (1-RTT) and zero in the resumption case (0-RTT). Cipher suites collapsed from hundreds to five. Padding oracles, CRIME, BEAST, Lucky13, FREAK, Logjam, ROBOT — almost all of them are simply not expressible in TLS 1.3.

The 1-RTT handshake — what each message carries

Client Hellolist of supported cipher suites (typically 5: TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_128_CCM_8_SHA256), supported groups (X25519, P-256, P-384, P-521), supported signature algorithms, ALPN list (h2, http/1.1, h3), SNI (the destination hostname, plaintext), and crucially a key share for one or more groups (the client speculatively sends a Diffie-Hellman public key).

Server Hellochosen cipher suite, server’s key share for the chosen group, and from this point the rest is encrypted under the derived handshake-traffic key.

Encrypted Extensionsserver sends its certificate, signs the handshake transcript so far (CertificateVerify), and a Finished message proving correctness.

Client Finishedclient validates everything, sends its own Finished. After this, application data flows under the application-traffic key. Total: 1 round-trip from client perspective. Compare to TLS 1.2: 2 RTT minimum, with separate ChangeCipherSpec messages and rolling-state complexity.

Forward secrecy — what it actually means

Forward secrecy (PFS) means: if the server’s long-term private key is compromised in the future, past recorded sessions cannot be decrypted. TLS 1.3 enforces PFS by mandating ephemeral Diffie-Hellman (ECDHE) for every session — the server’s long-term key is used only to sign the handshake, not to derive session keys.

Why this matters in 2026passive surveillance adversaries (state actors, insider snoops) record encrypted traffic now; if they later compromise a server’s RSA private key, with TLS 1.2 RSA-key-exchange they could decrypt years of recorded traffic. With TLS 1.3 PFS, that recorded traffic is permanently unreadable.

Implication for “TLS inspection” appliancesthere is no way to passively decrypt TLS 1.3 by knowing the server’s key — you must actively MITM with a trusted CA installed on clients. This is also why “session-key escrow” appliances cannot work transparently against modern TLS.

Certificates and validation — the part that goes wrong

Server identity is proved by a certificate signed by a CA the client trusts. The client verifies:

1the certificate is signed by a CA in its trust store;
2the certificate has not expired;
3the SNI matches a Subject Alternative Name in the cert;
4(optionally) the certificate has not been revoked (CRL or OCSP);
5(optionally) the certificate was logged in a Certificate Transparency log (now mandatory for browser trust). Common failures: expired certs (the cause of most “outage at midnight UTC” stories — set up monitoring with multiple alerts), missing intermediate CA in the chain (Apple is strict, Chrome is lenient — what works in browser fails on iPhone), name mismatch (cert valid for ringsafe.in but not www.ringsafe.in), hostname-validation bypasses in custom clients (CVE history of Java, Python urllib2 — modern stdlibs fixed). For monitoring: use crt.sh for CT visibility, expiration scanners (Hardenize, certinfo.io, your own automation), and pin internal CA roots in your service-mesh.

The dangerous extensions — 0-RTT and what it costs

TLS 1.3 0-RTT (early data) lets a returning client send application data in its very first message — useful for low-latency applications.

The hazard0-RTT data is not protected against replay. An attacker who captures the early-data packet can replay it later to the same server. For idempotent reads (GET requests) this is usually harmless. For state-changing operations (POST, PUT) it can cause double-submissions, payment retries, and worse.

Best practiceenable 0-RTT only for explicitly safe paths (static resources, GET-only APIs); reject 0-RTT for anything that mutates state. Many CDNs (Cloudflare, Fastly) expose this as a configuration toggle. The complexity is real; if you do not need the latency win, leave 0-RTT off.

Encrypted Client Hello (ECH) — the SNI privacy fix

Even with TLS 1.3, the SNI in Client Hello is plaintext — anyone on the path knows which hostname is being accessed. ECH (formerly ESNI) wraps the inner Client Hello (with the real SNI and cipher list) inside an outer Client Hello that uses a “public” SNI (typically the CDN’s own name). The outer SNI reveals only “this user is talking to Cloudflare/Fastly”, not the specific domain. The client retrieves the ECH public key via DNS HTTPS records (RFC 9460).

Adoption in 2026Cloudflare enables ECH by default; Firefox supports it; Chrome rolling out; major server stacks (nginx, OpenSSL 3.x) supporting it.

Enterprise impactSNI-based filtering at perimeter firewalls breaks for ECH-enabled connections — you see “going to Cloudflare”, not the specific tenant. Plan for SNI-based filtering being a transitional control; the long-term answer is endpoint visibility (EDR, host-based DNS), not perimeter SNI.

Reading TLS in Wireshark — without keys

Filter tls.handshake shows handshake messages. tls.handshake.type == 1 = Client Hello (visible plaintext: SNI, cipher suites, ALPN, supported groups). tls.handshake.type == 2 = Server Hello (chosen suite, key share). After Server Hello, everything is encrypted; you see only “Application Data” records and TLS record lengths.

What you can still inferhostname (from SNI unless ECH), connection start time, total bytes per direction, average packet size, the server’s identity from the certificate (if you decrypt with SSLKEYLOGFILE), and whether HTTP/2 or HTTP/3 was negotiated (from ALPN).

Decryption with SSLKEYLOGFILEset the environment variable in your browser before launch; Wireshark imports the file in Edit → Preferences → Protocols → TLS → “Pre-Master-Secret log filename”; entire session decrypts to plaintext. Useful for debugging your own apps; never use captures-from-others without consent.

Post-quantum TLS — what is coming and when to plan

A sufficiently large quantum computer will break current public-key crypto (RSA, ECDH, ECDSA). The threat is “harvest now, decrypt later” — adversaries record TLS-protected traffic today, decrypt when quantum arrives. NIST standardised post-quantum algorithms in 2024 (ML-KEM, ML-DSA, SLH-DSA). TLS 1.3 has been gaining hybrid post-quantum key-exchange in 2024-2025: X25519MLKEM768 combines classic ECDH with ML-KEM so the session is safe if either holds. Cloudflare, Google, Apple have deployed hybrid PQ in production; Mozilla and Chrome enable it by default.

For Indian enterprisestrack your CDN/cloud provider’s PQ rollout; long-lived keys (CA roots, signing keys) need migration plans; certificates are not yet PQ-signed but will be in 2027-2030. The realistic path: enable hybrid PQ in TLS where supported (a flag on most modern stacks); plan CA migration; participate in the long-tail upgrade.

Common TLS misconfigurations and the easy fixes

Run your endpoints through SSL Labs / Hardenize once a quarter and you will catch the usual: (1) Missing intermediate cert in chain — Apple devices fail the handshake, browsers may patch around. Fix: include full chain. (2) Cert valid only for apex, missing www. — fix: SAN list. (3) Weak ciphers offered (3DES, RC4, CBC modes pre-TLS-1.3) — fix: Mozilla “intermediate” config. (4) No OCSP stapling — minor; consider enabling. (5) No HSTS header — fix: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload. (6) No CAA record — fix: publish CAA at registrar. (7) Cert expiring <30 days; auto-renewal not configured — fix: Let’s Encrypt + cert-manager / certbot. (8) TLS 1.0/1.1 still enabled — fix: disable. Each takes minutes; collectively they move you from a B grade to A+ on most configurations.

Inspecting TLS in production — without breaking everything

Production TLS visibility patterns:

1SNI-based logging at perimeter — every TLS connection records the SNI; build a normalised dashboard of “SNIs seen per host”; new SNIs are noteworthy.
2JA3/JA4 fingerprinting on every TLS Client Hello; build dictionaries of normal application JA3s; new JA3s flag unrecognised tooling.
3Certificate transparency monitoring for your domains via crt.sh; alerts on unauthorised issuance.
4OCSP stapling status tracked from your endpoints; ensures revocation works.
5HSTS preload list verified for your apex domain; submit if not.
6SSL Labs / Hardenize automated weekly checks with grade thresholds. What not to do: avoid SSL/TLS proxy MITM unless you have prepared the policy, pinning exemptions, and DPDP-aligned disclosure. Better to instrument the visibility you can without decryption first; layer decryption only where the security need outweighs the operational and privacy cost.

Diagrams

TLS 1.3 1-RTT handshake — the only diagram you need
Client                                                  Server
  | --- ClientHello (key_share, SNI, ciphers) ----------> |
  |                                                       |
  | <-- ServerHello (key_share, chosen cipher) ---------- |
  | <-- {EncryptedExtensions, Cert, CertVerify, Finished}|  encrypted
  |                                                       |  with handshake key
  | --- {Finished} ------------------------------------> |  encrypted
  |                                                       |
  | === [Application Data] === <==> [Application Data] = |  encrypted
  |                                                       |  with app key

   1 round-trip from client perspective; everything after
   ServerHello is encrypted.
TLS 1.2 vs TLS 1.3 — what the wire looks like
TLS 1.2 — 2 RTT before app data:
  ClientHello → ServerHello, Cert, ServerKeyExchange, ServerHelloDone
              → ClientKeyExchange, ChangeCipherSpec, Finished
              ← ChangeCipherSpec, Finished
              → Application Data

TLS 1.3 — 1 RTT:
  ClientHello (with key_share) → ServerHello (with key_share),
     {Cert+verify+finished encrypted}
  Finished →
  Application Data

References & deeper reading

FAQ

Should I disable TLS 1.2 entirely?

In greenfield environments and modern web frontends, yes — Mozilla’s “modern” config is TLS 1.3-only. For mixed environments with legacy clients, dual TLS 1.2 + 1.3 with conservative TLS 1.2 cipher suites (only ECDHE, only AEAD) is the pragmatic baseline. Audit annually; the long tail of TLS 1.2-only clients is shrinking.

Why is OCSP-must-staple not universal?

Operationally fragile — if your OCSP responder goes down, your site goes down. Most operators rely on OCSP-stapling without “must-staple” so that a responder outage degrades to “no revocation check” rather than total failure. Browser-side OCSP is mostly skipped (privacy and reliability concerns); CRLite is the modern replacement.

How do I rotate certificates in a service mesh?

Short-lived certs (24-48 hours) issued by a per-mesh internal CA, with hot-reload. SPIFFE/SPIRE is the open-source standard; Istio + cert-manager is the common Kubernetes pattern. Long-lived certs in a mesh are an anti-pattern — they invariably outlive someone’s knowledge of where they came from.

Does HTTP/3 require TLS 1.3?

Yes — HTTP/3 is HTTP-over-QUIC, and QUIC mandates TLS 1.3 for its handshake. There is no “HTTP/3 over TLS 1.2.” If your CDN advertises HTTP/3, TLS 1.3 is implicitly the floor.

Is RSA still safe for certs in TLS 1.3?

For signing the handshake (where RSA is allowed), yes — choose RSA 2048+ or, better, ECDSA P-256. For key exchange, TLS 1.3 simply does not allow RSA — every TLS 1.3 connection is ECDHE. Plan certificate strategy around ECDSA where clients support it; RSA fallback for the long-tail.

How often should I rotate TLS certificates?

For automated cert lifecycle (ACME / Let’s Encrypt / Cert-Manager): every 60-90 days, fully automated. For manual private CA in legacy environments: 12 months max. Industry direction is shorter — Apple/Google/Mozilla pushing toward 90-day max for public certs by 2027. Build automation now.

What does "TLS termination at LB and re-encryption to backend" actually buy me?

L7 inspection capability (WAF, header rewriting), unified cert management, ability to rotate backend certs without touching public certs. Cost: the LB sees plaintext on its egress to backend; the LB-to-backend hop must be a trusted segment or use re-encryption. Most architectures pick re-encryption for regulated environments.


⚖️ Legal: Use any techniques described here only on networks you own or have explicit written authorisation to test. In India, unauthorised access is punishable under IT Act §66 (up to 3 years + fine). Pair offensive testing with a signed Statement of Work / Rules of Engagement; pair forensic activity with §65B-aligned chain of custody.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants