18.3. TLS Handshake Protocol

The TLS Handshake Protocol is layered on top of the TLS Record Protocol. It is used to authenticate the client and the server, to exchange cryptographic keys and to negotiate the used encryption and data integrity algorithms before the applications start to communicate with each other. Figure 18.1 illustrates the actual handshake message flow. First, the client and server exchange Hello messages. The client sends a ClientHello message, which is followed by the server sending a ServerHello message. These two messages establish the TLS protocol version, the compression mechanism used, the cipher suite used, and possibly the TLS session ID. Additionally, both a random client nonce and a random server nonce are exchanged, both of which are used in the handshake later on.

Then, the server may send any messages associated with the ServerHello. Depending on the selected cipher suite, it will send its certificate for authentication. The server may also send a key exchange message (e.g., if the server certificate is for signing only) and a certificate request message to the client, depending on the selected cipher suite. To mark the end of the ServerHello and the Hello message exchange, the server sends a ServerHelloDone message.

Next, if requested, the client will send its certificate to the server. In any case, the client will then send a key exchange message that sets the pre-master secret between the client and the server. The pre-master secret is used ...

Get The IMS: IP Multimedia Concepts And Services, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.