c++ - TLS 握手消息解析

标签 c++ networking ssl proxy openssl

我目前正在尝试将 tls 握手实现到我正在编写的 http 代理中。我知道我可以使用 OpenSSL 为我完成这项工作,但我有兴趣自己编写它。

我目前正在研究 TLS RFC,对如何解析 ClientHello 消息感到困惑,尤其是它可能有也可能没有 session ID,而且似乎没有计算密码套件的数量或压缩方法。

有谁知道最好的方法吗?

最佳答案

session_id 前面有长度。与密码套件和压缩算法相同。

您缺少的是 RFC 的第 4.3 节:

Variable length vectors are defined by specifying a subrange of legal lengths, inclusively, using the notation . When encoded, the actual length precedes the vector's contents in the byte stream. The length will be in the form of a number consuming as many bytes as required to hold the vector's specified maximum (ceiling) length. A variable length vector with an actual length field of zero is referred to as an empty vector.

关于c++ - TLS 握手消息解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7786507/

相关文章:

c++ - BIO_do_connect() 似乎失败是因为使用了 SSL v3,有没有办法获得更多诊断信息?

java - 解决 javax.net.ssl.SSLHandshakeException : sun. security.validator.ValidatorException : PKIX path building failed Error?

c++ - 我可以只从迭代器访问结尾吗?

c++ - 如何在centos中的c中从IP获取以太网适配器名称

java - 从网站 XML 数据动态填充 ListView Android

Golang SSH 到思科无线 Controller 并运行命令

r - 如何在 R 的 networkDynamic 对象中多次有效地激活边缘属性?

ssl - Nginx - 上游 SSL - SSL 握手中的对等关闭连接

c++ - C++中的拷贝构造函数是什么?

c++ - *** 内部错误 : unable to open jobserver semaphore '3,4' : (Error 2: The system cannot find the file specified. )。停止