在 nginx 中禁用客户端发起的安全重新协商

问题描述 投票:0回答:2

我使用 Nginx 1.19.6 和 OpenSSL 1.1.1i。 但我检查了我的服务器支持客户端发起的安全重新协商... (https://www.immuniweb.com/ssl/?id=Ek4FSF6C)

我不知道为什么我的服务器支持客户端发起的安全重新协商。

检查代码:

openssl s_client -connect gjan.info:443 -msg -tls1_2

结果:

---
R
RENEGOTIATING
>>> ??? [length 0005]
    16 03 03 00 f6
>>> TLS 1.2, Handshake [length 00de], ClientHello
    01 00 00 da 03 03 cb bf ab b8 6f a1 31 14 2d fb
    ad 63 aa d2 15 c6 5d fc 8c 19 fc db 4c 7f 5b d8
    f1 f1 fd f3 29 fa 00 00 36 c0 2c c0 30 00 9f cc
    a9 cc a8 cc aa c0 2b c0 2f 00 9e c0 24 c0 28 00
    6b c0 23 c0 27 00 67 c0 0a c0 14 00 39 c0 09 c0
    13 00 33 00 9d 00 9c 00 3d 00 3c 00 35 00 2f 01
    00 00 7b ff 01 00 0d 0c 1b a5 84 2c 92 28 da 6e
    0c 84 5f c4 00 00 00 0e 00 0c 00 00 09 67 6a 61
    6e 2e 69 6e 66 6f 00 0b 00 04 03 00 01 02 00 0a
    00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23
    00 00 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e
    04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b
    08 04 08 05 08 06 04 01 05 01 06 01 03 03 02 03
    03 01 02 01 03 02 02 02 04 02 05 02 06 02
<<< ??? [length 0005]
    15 03 03 00 1a
<<< TLS 1.2, Alert [length 0002], warning no_renegotiation
    01 64
>>> ??? [length 0005]
    15 03 03 00 1a
>>> TLS 1.2, Alert [length 0002], fatal handshake_failure
    02 28
547636304368:error:14094153:SSL routines:ssl3_read_bytes:no renegotiation:../ssl/record/rec_layer_s3.c:1560:

只是 ImmuniWeb 错误还是我的网络服务器真的受支持?如果支持如何禁用?

nginx ssl openssl
2个回答
0
投票

可能无法使用 nginx 中的设置来解决此安全问题。但是,您可以向 nginx 开发人员推荐此答案,以便他们可以在代码库中进行适当的更改。正如其他答案所示,这不仅仅是 immuniweb

OpenSSL 1.1.1 中添加了 SSL_OP_NO_RENEGOTIATION 选项。为了使 immuniweb 给您提供与我们相同的分数 (A+),您需要设置 SSL_OP_NO_RENEGOTIATION 以禁用 TLSv1.2 及更早版本中的所有重新协商。这需要在创建 SSL_CTX 的位置进行设置。您可能还需要进行其他更改才能获得所需的分数。

SSL_CTX *ssl_ctx = SSL_CTX_new(TLS_method());
...
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_RENEGOTIATION);

来源:SSL_CTX_set_options man 1.1.1


0
投票

这只是immuniweb。 Qualys/ssllabs正确显示

Secure Renegotiation    Supported
Secure Client-Initiated Renegotiation   No
Insecure Client-Initiated Renegotiation     No

第一个表示握手过程中的RFC5746协商;第二个和第三个表示客户端发起的实际重新协商失败。

© www.soinside.com 2019 - 2024. All rights reserved.