Nginx 1.15.6 和 openssl 1.1.1 ,EarlyData 未发送

1 openssl nginx tls1.3

我们设置了“ ssl_early_data on; ”和“ proxy_set_header Early-Data $ssl_early_data ;” 在使用 openssl 1.1.1 构建的 nginx 1.15.6 配置中,但是当我们运行以下命令时,它显示 EarlyData 未发送。知道如何解决这个问题吗?

openssl s_client -connect www.rupeevest.com:443

SSL握手已读取4693字节并写入399字节

验证:确定

新,TLSv1.3,密码为 TLS_AES_256_GCM_SHA384 服务器公钥为 2048 位 不支持安全重新协商 压缩:无 扩展:无 未协商 ALPN 未发送早期数据

验证返回码:0(确定)


nag*_*ter 5

为了发送“早期数据”,客户端和服务器必须支持PSK交换模式(会话cookie)。请参阅https://www.rfc-editor.org/rfc/rfc8446#section-2.3

要验证使用 OpenSSL,作为用例示例,首先将会话保存到文件中,然后使用该会话文件并将早期数据(HTTP 请求)发送到服务器。

$ host=www.example.org # replace with your server name
$ echo -e "HEAD / HTTP/1.1\r\nHost: $host\r\nConnection: close\r\n\r\n" > request.txt
$ openssl s_client -connect $host:443 -tls1_3 -sess_out session.pem -ign_eof < request.txt
$ openssl s_client -connect $host:443 -tls1_3 -sess_in session.pem -early_data request.txt
Run Code Online (Sandbox Code Playgroud)

请注意,您的服务器必须支持 TLS 1.3 和 0-RTT,否则该示例将无法运行。

希望这可以帮助!