Security advanced LIVE DEMO
πŸ”’

TLS 1.3 vs TLS 1.2 Handshake

Compare the TLS 1.3 and TLS 1.2 handshake processes side-by-side. Understand 1-RTT negotiation, encrypted post-ServerHello messages, and forward-secret keys.

tlssslhttpsencryptionsecuritylatency
Interactive Demo

Continue with the guided workspace

Use the paired workspace to connect this guide's mental model with live component state, visible signals, and the outcome each step or scenario is meant to prove.

Transport Layer Security (TLS) has evolved to optimize both security and performance. The transition from TLS 1.2 to TLS 1.3 represents a major milestone in networking, cutting connection setup latency in half and encrypting handshake metadata by collapsing the handshake from two round trips to one.

Mental Model

Think of a TLS handshake like establishing a secure line of credit. In TLS 1.2, you make one call to agree on a secret language (Client/ServerHello), a second call to send and verify ID cards (Certificate), and a third call to confirm everything works before you buy anything (ChangeCipherSpec/Finished) β€” taking two full round trips. In TLS 1.3, you send a key share along with the first message. After ServerHello selects the shared secret, the server sends its certificate and the remaining handshake messages under handshake protection; the ordinary ClientHello SNI is a separate privacy concern. You compute the secret code locally, confirm the ID, and immediately start buying thingsβ€”saving one entire round trip.

Components and Why They Exist

Client

The client initiates the TLS handshake and negotiates protocol parameters to establish an encrypted channel. In the TLS 1.3 lane, the client attaches speculative ephemeral key shares alongside proposed cipher suites in its very first ClientHello packet, then validates the server’s encrypted certificate chain and signature before sending application data.

Server

The server authenticates its domain identity and completes key agreement with the connecting client. Upon receiving ClientHello, it selects the cipher suite, generates its own ephemeral key share, and replies with an encrypted certificate chain in TLS 1.3 (versus a plaintext certificate in TLS 1.2), completing key exchange in a single round trip.

Network Lifelines (RTT Tracks)

The network lifelines plot the chronological Round-Trip Time (RTT) message flights between the client and server. Comparing the two vertical timeline tracks side by side shows TLS 1.3 packets reaching encrypted application data after 1-RTT, one full round trip earlier than the 2-RTT TLS 1.2 sequence.

Edge Cases and Misconceptions

  • Symmetric Keys are Negotiated Ephemerally: In both protocols, the heavy data payload is encrypted using symmetric key cryptography (e.g. AES). The asymmetric handshake keys are used only to safely negotiate this transient symmetric session key.
  • TLS 1.3 handshake confidentiality has a boundary: TLS 1.3 encrypts the Certificate and later handshake messages after ServerHello. The ordinary ClientHello, including SNI, is still visible unless ECH is negotiated, so certificate encryption does not by itself hide the requested hostname.
  • Obsolete Cryptographic Algorithms: TLS 1.2 supports weak algorithms like MD5, SHA-1, RC4, and static RSA key exchange. TLS 1.3 deprecated these entirely, only supporting secure AEAD ciphers and forward-secure Diffie-Hellman groups.

Key Differences Summary

FeatureTLS 1.2TLS 1.3
Handshake Latency2-RTT1-RTT
Certificate PrivacyPlaintext (Leaked metadata)Encrypted (Secure metadata)
Cipher Negotiation2 round trips1 round trip
Obsolete CiphersSupported (static RSA, custom DH)Removed (PFS-only DH, AEAD-only)

Common Questions

Why is TLS 1.3 faster than TLS 1.2?

TLS 1.3 performs key negotiation in a single round-trip (1-RTT) by combining the key share exchange with the ClientHello, whereas TLS 1.2 requires two round-trips (2-RTT) before application data can be sent.

How does TLS 1.3 protect client privacy better than TLS 1.2?

TLS 1.3 encrypts the handshake messages sent after ServerHello, including the server Certificate. The ordinary ClientHello SNI remains visible to the network unless Encrypted ClientHello (ECH) is used, so certificate confidentiality should not be described as complete hostname privacy.

What is a Key Share in TLS 1.3?

A key share is the client's public key for an ephemeral Diffie-Hellman key exchange, sent in the ClientHello. This allows the server to immediately derive the shared secret in its first response.

What does perfect forward secrecy (PFS) mean and why does TLS 1.3 enforce it?

Perfect Forward Secrecy ensures that if a server's long-term private key is compromised in the future, it cannot be used to decrypt past sessions that were recorded. TLS 1.3 enforces PFS by deprecating static RSA key exchanges and requiring ephemeral Diffie-Hellman key exchange for every session.

What are AEAD ciphers and why does TLS 1.3 use them exclusively?

Authenticated Encryption with Associated Data (AEAD) ciphers (like AES-GCM or ChaCha20-Poly1305) provide both confidentiality (encryption) and integrity validation (authenticity) in a single optimized operation. TLS 1.3 removed older, less secure cipher modes that separated encryption and integrity check stages, eliminating vulnerabilities like padding oracle attacks.

Why does a TLS 1.3 handshake fail if there is a 'Key Share Mismatch'?

If the client does not send a key share for the elliptic curve group preferred by the server, the server sends a HelloRetryRequest specifying the desired group. The client must then send a new ClientHello with the matching share. This fallback increases the handshake latency to 2-RTT, matching TLS 1.2's latency.

How does TLS 1.3 achieve 0-RTT session resumption?

During a previous connection, the client and server negotiate a Pre-Shared Key (PSK). On subsequent connections, the client encrypts application data using this PSK and sends it immediately with the ClientHello (0-RTT), achieving zero-latency reconnection.

What is the role of the SNI (Server Name Indication) extension?

SNI is a header sent in the ClientHello that tells the server which host name the client is trying to reach. This allows a single IP address to host multiple secure domains, as the server can inspect the SNI to select the correct TLS certificate to return.