SSL/TLS handshake Protocol
Secure Sockets Layer (SSL) and its newer version Transport Layer Security (TLS) are cryptographic protocols that provide security over the internet.
SSL/TLS handshake protocol is done between the client and the webserver to establish trust and carry out encrypted communications (encryption at the sender’s end and decryption at the receiver's end).
The protocol belongs to the top 3 OSI layers or in the TCP/IP model in the application layer.
STEPS
- The client sends a message to the server with information about SSL/TLS version, the cryptographic algorithms, and the data compression methods used by the client.
- The server sends a message to the client to the client with cryptographic algorithm agreement, session ID, the public key, and digital certificate.
- The client then contacts the CA to verify the authenticity of the digital certificate. This is the trust-building step.
- The client sends a shared secret key to be used for the conversation. The secret key is encrypted with the server’s public key.
- The client sends a finished message indicating that the handshake was successful from the client’s side.
- The server then sends a similar finished message indicating that the handshake was successful from the server’s side.
Both the client and the server can now be friends and exchange gossips.