概述

An HTTPS connection involves two parties: the client (the one who is initiating the connection, usually your web browser), and the server. These two parties are the ones that ‘shake hands.’ The purpose of the SSL/TLS handshake is to perform all the cryptographic work needed to have a secure connection. This includes authenticating the SSL certificate being used, and generating an encryption key.

the TLS handshake accomplishes 3 main things:

  1. Exchanging cipher suites and parameters
  2. Authenticating one or both parties
  3. Creating/Exchanging symmetric session keys

Why need it

How it work

Negotiating Cipher Suites

Authentication

Key Exchange

The last part of the TLS handshake involves creating the “session key,” which is the key that will actually be used for secure communication.

附录

理解ssl-ciphers

我们以ECDHE-ECDSA-AES128-GCM-SHA256来做示例说明,

字段名字段说明
ECDHEKey Exchange: Elliptic Curve Diffie-Hellman Ephemeral (ECDHE)
ECDSAAuthentication: Elliptic Curve Digital Signature Algorithm (ECDSA)
AES128-GCMEncryption: Advanced Encryption Standard with 128bit key in Galois/Counter mode (AES 128 GCM)
SHA256Hash: Secure Hash Algorithm 256 (SHA256)

参考

  1. Taking a Cloer Look at the SSL/TLS Handshake
  2. 彻底搞懂HTTPS的加密原理
  3. SSL Configuration Generator
  4. How to identify the Cipher used by an HTTPS Connection
  5. TLS Elliptic Curve Cipher Suites with SHA-256/384 and AES Galois Counter Mode (GCM)