1, the client input HTTPS URL, linked to the server443 port;
2, the server has a key and a lock, the lock is passed to the client. A digital certificate is both a public key and a lock
3, the client gets the lock, generates a random number, locks up the random number with the lock (encrypted), and then passes it to the server. This random number becomes the private key, and now only the client knows
4, the server with the key to open the lock, get random number. The random number becomes a new lock, locks the content (encrypted), and then passes it to the client. This random number server also knows and uses it to encrypt the data.
5, the client uses its own key (random number) to decrypt and get the content. client decrypts data with private key
6, the next client and server data exchange through this random number to encrypt. only the client and the server know the private key, so the data transfer is secure, not plaintext
The illustrations are as follows:
HTTPS three-time handshake