java https tls_https中的TLS协议详解

协议记录层(Record Protocol format)的格式TLS 记录的头部有三个组成部分第0个字节: TLS 记录的类别第1-2个字节: TLS 版本(主版本/次版本)第3-4个字节:包含头部在内的总长度Length of data in the record (excluding the header itself). The maximum supported is 16384 (16...
摘要由CSDN通过智能技术生成

协议记录层(Record Protocol format)的格式

TLS 记录的头部有三个组成部分

第0个字节: TLS 记录的类别

第1-2个字节: TLS 版本(主版本/次版本)

第3-4个字节:包含头部在内的总长度

Length of data in the record (excluding the header itself). The maximum supported is 16384 (16K).

record type (1 byte)

/

/ version (1 byte major, 1 byte minor)

/ /

/ / length (2 bytes)

/ / /

+----+----+----+----+----+

| | | | | |

| | | | | | TLS Record header

+----+----+----+----+----+

Recode Type的种类

Record Type Values

dec

hex

CHANGE_CIPHER_SPEC

20

0x14

ALERT

21

0x15

HANDSHAKE

22

0x16

APPLICATION_DATA

23

0x17

版本号的种类

Version Values

dec

hex

SSL 3.0

3,0

0x0300

TLS 1.0

3,1

0x0301

TLS 1.1

3,2

0x0302

TLS 1.2

3,3

0x0303

TLS1.3

3,4

0x0304

握手协议(Handshake Protocol)的格式

握手协议在recode Layer的type是22,后面会包括握手的类型,握手消息的长度,和消息体三部分。

Handshake Type是8位

handshake message length 24位

|

|

|

Record Layer | Handshake Layer

| |

| | ...more messages

+----+----+----+----+----+----+----+----+----+------ - - - -+--

| 22 | | | | | | | | | |

|0x16| | | | | | | | |message |

+----+----+----+----+----+----+----+----+----+------ - - - -+--

/ / | \ \----\-----\ |

/ / | \ \

type: 22 / | \ handshake message length

/ type

/

length: arbitrary (up t

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值