跳到主要内容

10. 应用数据协议 (Application Data Protocol)

application data message 使用当前活动 connection state 承载, 并由 record layer 进行分片, 压缩和加密. TLS 将这些 message 视为透明数据.

Application Data Protocol 结构:

struct {
opaque fragment[TLSPlaintext.length];
} ApplicationData;

Application Data Protocol 的关键特性:

  1. Transparent Transport: TLS 不解释 application layer data 的内容.
  2. Fragmentation: 大块数据会被分片为多个 TLS record.
  3. Order Guarantee: TLS 保留 application data 的顺序.
  4. Security Protection: 所有 application data 使用协商出的 cipher suite 保护.

在 handshake 完成之前, 即收到并验证 Finished message 之前, 不得发送 application data message.

应用负责确保通过 TLS connection 发送的数据适合可用 record size limit, 最大为 2^14 byte.