This figure shows the handshake messages for a typical SSL connection between a Web server and a browser.
The client sends a Hello message to the server.
The server responds by sending a Hello message to the client.
The server sends its certificate to the client.
The client authenticates the server using the server's certificate.
The client generates a random value ("pre-master secret"), encrypts it using the server's public key, and sends it to the server.
The server uses its private key to decrypt the message to retrieve the pre-master secret.
The client and server separately calculate the keys that will be used in the SSL session.
The client and server send a Finished message to each other.
The client and server now transfer data using the encryption and hashing keys and algorithms.