HTTPS知识点

所谓https即http secure/http over ssl/http over tls,在http基础上增加一层加密。

流程如下:

  1. Client Hello(C -> S)
  • 可选TLS版本
  • 可选加密套件(对称加密算法,非对称加密算法、hash算法)
  • 随机数
  1. Server Hello (S -> C)
  • 返回客户端和服务端均支持的TLS版本、算法
  • 随机数
  1. Server Status(S -> C)
  • 服务器公钥
  • 服务器公钥签名(hash)(证书签发机构私钥签名服务器公钥后的hash值)
  • 用于验证公钥签名(hash)的公钥(证书签发机构公钥)
  1. 客户端加密数据(C -> S)
  • Client Key Exchange:Pre-master secret(随机数)通过三个随机数生成Master Secret (防止replay attack)

  • Change Cipher Spec:使用加密通信

  • Encrypted Handshake Message:通过客户端加密密钥加密(准备发送Encrypted handshake message前)的握手消息

  • Finished

  1. 服务端加密数据(S -> C)
  • Change Cipher Spec:使用加密通信
  • Encrypted Handshake Message:通过客户端加密密钥加密(准备发送Encrypted handshake message前)的握手消息
  • Finished
  1. 数据传输

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!