If you provision a certificate, point your load balancer at it, and move on, TLS feels like solved infrastructure. That instinct mostly serves you well until something breaks in a way your mental model cannot explain: a client fails to resume sessions, an idempotent-looking request executes twice, or your packet capture suddenly shows nothing useful. All three of those trace back to the same event — the transition from TLS 1.2 to TLS 1.3, which did not just add cipher suites. It rebuilt the handshake from the ground up.
This post walks through what actually changed in the TLS 1.3 handshake, why each change was made, and where the practical traps are — particularly around session resumption and 0-RTT early data, which is the feature most likely to surprise you in production.
From Two Round-Trips to One
A TLS 1.2 handshake costs two round-trips before the first application byte: one to exchange key-agreement parameters, one for the client to confirm. TLS 1.3 collapses this to one round-trip by making a bet: because the protocol now supports only a small, well-known set of key-exchange groups (X25519, P-256, and a few others), the client can safely guess what the server supports and send its Diffie-Hellman share in the very first message.
The flow looks like this:
Client Server
------ ------
ClientHello
+ key_share (client's DH share) -------->
ServerHello
+ key_share (server's DH share)
{EncryptedExtensions}
{CertificateRequest*}
{Certificate*}
{CertificateVerify*}
{Finished}
<-------- [Application Data*]
{Certificate*}
{CertificateVerify*}
{Finished} -------->
<-------- [NewSessionTicket]
[Application Data] <------> [Application Data]
Both sides can derive the shared secret immediately after the first flight, because each already holds the other’s key share. If the guess is wrong — the server does not support any offered group — the server replies with a HelloRetryRequest telling the client which group to use, and the handshake degenerates to two round-trips. That is the fallback path, not the norm; in practice X25519 is universally supported and retries are rare.
Everything After ServerHello Is Encrypted
In TLS 1.2, the ServerHello, certificate chain, and most of the handshake travel in cleartext. Anyone on the path — your ISP, a firewall, a middlebox — sees exactly which hostname you connect to and which certificate the server presents. TLS 1.3 encrypts everything after the ServerHello under keys derived from the key exchange. The certificate chain, the extensions, the Finished messages: all opaque.
This is a real privacy improvement, and a real operational change. Passive monitoring of TLS traffic — the kind security teams used to extract the SNI hostname and validate certificates out of band — stops working. If you rely on middlebox inspection, you now need explicit trust anchors (TLS inspection appliances that terminate and re-originate the connection) rather than passive sniffing. Note that the plaintext ClientHello still leaks the SNI hostname; fully hiding it requires Encrypted Client Hello, which is a separate extension layered on top, deployed progressively across the ecosystem.
What Got Deleted, and Why
TLS 1.3 removed an entire museum wing of legacy mechanisms:
- Static RSA key exchange. The client encrypting a pre-master secret with the server’s RSA certificate key provided no forward secrecy — capture the traffic today, steal the key tomorrow, decrypt everything. TLS 1.3 only allows ephemeral (EC)DHE or PSK-based establishment, so recorded sessions stay unreadable without the ephemeral keys.
- CBC cipher suites. The MAC-then-encrypt construction in CBC mode enabled the padding-oracle family of attacks (Lucky13 and friends). TLS 1.3 permits only authenticated encryption: AEAD ciphers like AES-GCM and ChaCha20-Poly1305.
- Compression, renegotiation, and custom Diffie-Hellman parameters. Compression leaked secrets (CRIME), renegotiation enabled interception, and user-specified DH groups were the source of the Logjam weak-key problem.
- Session IDs and session tickets. Replaced wholesale by the PSK mechanism described below.
The deletions matter more than the additions. A protocol that offers fifty cipher suites is a protocol with fifty attack surfaces; TLS 1.3 ships with a handful of suites, and every connection gets forward secrecy.
Resumption via Pre-Shared Keys
After a full handshake completes, the server sends a NewSessionTicket: an opaque identifier bound to a secret derived from the just-completed connection. On the next connection, the client presents that identity in a pre_shared_key extension. If the server accepts it, both sides derive keys from the original shared secret instead of running a fresh Diffie-Hellman exchange — no certificate verification, no signatures, and the handshake shortens further.
Two details matter. First, the client should still send a key_share alongside the PSK. If the server declines resumption (ticket expired, unknown identity), it falls back to the full DH handshake using that share instead of forcing another round-trip. Second, PSK-only resumption loses forward secrecy: the resumed connection is only as strong as the original one. The common configuration combines the PSK with a fresh DHE exchange, keeping forward secrecy while skipping certificate processing.
0-RTT Data: The Fast Path That Bites
With a PSK in hand, TLS 1.3 lets the client send application data in its very first flight — before the server has said anything. The early data is encrypted under keys derived from the PSK itself. For a connection doing a single GET against an API, this eliminates the entire handshake latency: zero round-trips.
The catch is that the server cannot bind early data to a specific handshake, because there is no handshake yet when the client sends it. An attacker who captures 0-RTT traffic can replay it verbatim, and the server will decrypt and process it again. The protocol includes ticket-age validation and single-use ticket tracking to narrow the window, but neither eliminates the fundamental property: 0-RTT data has no replay protection you can rely on. The specification is blunt about this — early data must be treated as potentially duplicated.
The mitigation is application-level, and it rhymes with idempotency design elsewhere in distributed systems. Anything idempotent is safe to send as early data: GET requests, requests carrying an explicit idempotency key the server deduplicates. Anything state-mutating with side effects — POST /orders, password changes — is not, unless you have replay rejection at the application layer. Browsers know this and restrict early data to safe methods by default; a hand-rolled client gets no such courtesy.
TLS 1.3 in Go
Go’s standard library enables TLS 1.3 by default for clients since Go 1.13, and the knobs are minimal. A client that explicitly opts into TLS 1.3 and keeps a session cache for resumption:
package main
import (
"crypto/tls"
"fmt"
"net/http"
"time"
)
func main() {
// ClientSessionCache enables PSK resumption and (for servers that
// permit it) 0-RTT. Without a cache, every connection pays the
// full 1-RTT handshake.
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS13,
ClientSessionCache: tls.NewLRUClientSessionCache(256),
},
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
},
}
resp, err := client.Get("https://example.com/health")
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("TLS:", resp.TLS.HandshakeComplete, resp.TLS.NegotiatedProtocol)
}
On the server side, accepting early data is opt-in per listener, and the application must decide whether each request received in early data is safe to process:
srv := &http.Server{
Addr: ":8443",
Handler: mux,
TLSConfig: &tls.Config{
MinVersion: tls.VersionTLS13,
},
}
// http.Server surfaces 0-RTT status per request via TLS handshake state;
// guard non-idempotent handlers yourself.
mux.HandleFunc("/orders", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet && requestWasEarlyData(r) {
http.Error(w, "replay-unsafe method over 0-RTT", http.StatusPreconditionFailed)
return
}
// ... normal handling with an idempotency-key dedup layer ...
})
srv.ListenAndServeTLS("cert.pem", "key.pem")
Practical Consequences Worth Remembering
- Session resumption is per cache, per process. A client with no session cache (or one that restarts often) pays the full handshake every time; connection pooling and warm caches are latency features.
- Traffic captures of TLS 1.3 show far less than they used to. Build observability on telemetry exported by the endpoint (handshake duration, negotiated version, resumed-or-not flags) rather than on-the-wire inspection.
- Downgrade protection is built in: the last bytes of the ClientHello random encode a special value when a server that supports 1.3 falls back to an older version, letting peers detect tampering with the negotiation.
- 0-RTT is a latency optimization for idempotent first requests — mostly connection re-establishment probes — not a general “send my POST earlier” feature.
TLS 1.3 is a smaller protocol that does more: one round-trip, encrypted handshake, mandatory forward secrecy, and resumption that scales down to zero round-trips when used carefully. The full specification lives in RFC 8446, and the crypto/tls documentation covers the Go-side configuration surface. The parts that will actually bite you — early data replay and lost passive visibility — are operational properties, not configuration flags, so design for them at the application layer before the first incident hands you the lesson.