【问题标题】:Remove SCSV Cipher Suite from php curl https request从 php curl https 请求中删除 SCSV Cipher Suite
【发布时间】:2023-03-11 03:00:01
【问题描述】:

在 ubuntu 服务器中使用 php-curl 发出 https 请求时,我发现它添加了一个额外的密码套件,该套件被标识为“EMPTY-RENEGOTIATION-INFO-SCSV”。 我知道这是一个假的密码套件,但是,我想从 https 请求中删除这个密码套件。 是否有任何 curlopt 参数或 openssl 扩展或 apache 配置文件可用于停止此默认行为。 谢谢你

【问题讨论】:

  • 如果 cURL 使用的是 OpenSSL ,那么您需要 SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 选项。但我不确定当 NSS 可用时 cURL 是否使用 OpenSSL。另请参阅 curl: (52) Empty reply from server 和 OpenSSL 的 SSL_CTX_set_options man page
  • 我也不确定 curl 是否正在使用 openssl,但我需要从 https 请求中删除密码。如何在 NSS 中禁用它?

标签: php ssl curl openssl libcurl


【解决方案1】:

这个“密码”记录在RFC 5746 section 3.3 中。这是一种对抗 CVE-2009-3555 和其他地方描述的前缀攻击的方法。

This SCSV is not a true cipher suite (it does not correspond to any
valid set of algorithms) and cannot be negotiated. Instead, it has
the same semantics as an empty "renegotiation_info" extension, as
described in the following sections. Because SSLv3 and TLS
implementations reliably ignore unknown cipher suites, the SCSV may
be safely sent to any server.

因此,您无需使用 curl 提供的常规密码套件选项 (CURLOPT_SSL_CIPHER_LIST) 禁用/启用此功能,而是需要让 TLS 库允许不安全重新协商。

我不认为 PHP 允许你这样做,并且 libcurl 没有提供它的选项,所以我相信你必须修补 C 源代码才能实现它。

这也在OpenSSL's documentation 中对SSL_CTX_set_options() 进行了进一步描述。

【讨论】:

  • 谢谢,有没有办法降级任何版本来解决问题?
猜你喜欢
  • 2021-03-16
  • 2023-04-07
  • 1970-01-01
  • 1970-01-01
  • 2019-05-01
  • 2011-11-17
  • 1970-01-01
  • 2013-06-30
  • 1970-01-01
相关资源
最近更新 更多