TLS 1.3 Handshake Protocol

The handshake protocol is used to negotiate the security parameters of the connection. The handshake messages are provided to the TLS recording layer, where they are encapsulated into one or more TLSPlaintext or TLSCiphertext, and they are processed and transmitted according to the current active connection state. Protocol messages must be sent in a certain order (see below for the order). If the peer finds that the received handshake messages are not in the right order, they must use the "unexpected_message" alert message to abort the handshake.