我正在尝试将 TLS 1.1 和 1.2 支持添加到已经支持 TLS 1.0 的数据包捕获产品中。
我使用 Wireshark 来捕获我的浏览器和 openssl 服务器之间的流量以生成一些测试用例。我在我创建的所有跟踪中看到了一个意外的 TLS 版本。
Secure Sockets Layer
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Version: TLS 1.0 (0x0301)
Length: 105
Handshake Protocol: Client Hello
Handshake Type: Client Hello (1)
Length: 101
Version: TLS 1.2 (0x0303)
以上是 Wireshark 报告的 TLS 1.2 跟踪之一的摘录。在 ClientHello 中给出的版本是 TLS 1.0,在所有后续消息中是 1.2。这发生在 TLS 1.1 和 1.2 跟踪中。
附录 E.1。(与 TLS 1.0/1.1 和 SSL 3.0 的兼容性)来自 TLS 1.2 RFC 说:
Earlier versions of the TLS specification were not fully clear on
what the record layer version number (TLSPlaintext.version) should
contain when sending ClientHello (i.e., before it is known which
version of the protocol will be employed). Thus, TLS servers
compliant with this specification MUST accept any value {03,XX} as
the record layer version number for ClientHello.
这本身对我来说也有点模棱两可。
所以我的问题是:
- 这个字段可以是一个完全任意的值(只要它是 SSLv3 或更高版本)?
- 行为是否会根据此字段中给出的版本而改变?
- 浏览器选择 TLS 1.0 而不是 SSLv3 有什么意义吗?
有关的:
- https://security.stackexchange.com/a/26059/7866这个答案表明应该在 ClientHello 中使用 SSLv3 以获得最大的互操作性。提到互操作性意味着服务器关心给定的值。