TLS - Full Handshake
full handshake requires 3 round trips:
- 1 round trip for TCP 3-Way Handshake (note the last TCP ACK message is sent with the first TLS ClientHello message)
- 2 round trips for TLS cipher-suite choosing, certificate exchange, client-key-exchange, finished message
-model/5---session-layer/secure-sockets-layer-(ssl)---transport-layer-security-(tls)/ssl/tls---optimizing-handshaking/2.png)
Optimizing TLS Handshakes
For Starting New Session
- False Start - send application data right after ChangeCipherSpec message is sent
-model/5---session-layer/secure-sockets-layer-(ssl)---transport-layer-security-(tls)/ssl/tls---optimizing-handshaking/false-start.jpg)
For Resuming A Session
- Abbreviated Handshake - https://blogs.msdn.microsoft.com/huizhu/2009/12/17/ssl-tls-full-handshake-vs-abbreviated-handshake/
- uses 2 mechanisms:
- session IDs -
- session tickets -
- the difference between TLS Full handshake and TLS Abbreviated Handshake is that abbreviated handshake is using 32 bit existing SSL session ID for Client Hello. If SSL server agreed on this session, server doesn’t need to send the public key of certificate back to client. Also, client doesn’t need to take time to validate the server cert as it is an existing session. If server doesn’t agree on the SSL session, server needs to push a new session ID and then go to full handshake.
- uses 2 mechanisms:
- Resumption and Pre-Shared Key (PSK) - https://tools.ietf.org/html/rfc8446#section-2.2
- introduced in TLS 1.3
- deprecates TLS Abbreviated Handshake
The combination of both: False Start & Abbreviated Handshake allows us to deliver a consistent 1-RTT TLS handshake for new and returning visitors, plus computational savings for sessions that can be resumed based on previously negotiated session parameters. Make sure to take advantage of these optimizations in your deployments.
NOTE:
One of the design goals for TLS 1.3 is to reduce the latency overhead for setting up the secure connection: 1-RTT for new, and 0-RTT for resumed sessions!
TODO Description
|
Session Resumption |
Description |
|---|---|
|
TLS 1.3 |
Resumption and Pre-Shared Key (PSK)
|
|
TLS 1.2 |
”session IDs” and “session tickets”Two mechanisms can be used to accomplish an abbreviated handshake:
The ticket mechanism is a TLS extension. The client can advertise its support by sending an empty “Session Ticket” extension in the “Client Hello” message. The server will answer with an empty “Session Ticket” extension in its “Server Hello” message if it supports it. If one of them does not support this extension, they can fallback to the session identifier mechanism built into TLS. RFC 5077 identifies situations where tickets are desirable over session identifiers. The main improvement is to avoid to maintain a server-side session cache since the whole session state is remembered by the client, not the server. A session cache can be costly in term of memory and difficult to share between multiple hosts when requests are load-balanced across servers. |