gpt4 book ai didi

python - SSL v3 握手失败(但仅在较新版本的 OpenSSL 中)

转载 作者:太空宇宙 更新时间:2023-11-03 13:11:41 27 4
gpt4 key购买 nike

Python 3.5 中的这个基本片段,针对特定网站,失败并显示 requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:720)

import requests
requests.get("https://ssbp.mycampus.ca/prod_uoit/bwskfshd.P_CrseSchdDetl")

它在 Ubuntu 16.04 上工作得很好,但具有相同版本的所有 Python 依赖项的完全相同的脚本在 Debian Stretch 上失败。

我已经尝试安装 requests[security],但没有任何区别。我的安装之间唯一显着的区别是 Debian 有 OpenSSL 1.1.0c 2016 年 11 月 10 日,而 Ubuntu 有版本 OpenSSL 1.0.2g 2016 年 3 月 1 日

一定是更新版本的 OpenSSL 导致它失败。

使用的requests版本是2.11.1

最佳答案

服务器 only supports一个单一的旧密码:DES-CBC3-SHA。此密码被认为是弱密码 (SWEET32),并已从 OpenSSL 1.1.0 的默认构建中删除。由于 Debian 遵循默认构建,因此密码在较新的 Debian 版本上不可用。

来自 Changes between 1.0.2h and 1.1.0 :

To mitigate the SWEET32 attack (CVE-2016-2183), 3DES cipher suites have been disabled by default and removed from DEFAULT, just like RC4. See the RC4 item below to re-enable both.
...
RC4 based libssl ciphersuites are now classed as "weak" ciphers and are disabled by default. They can be re-enabled using the enable-weak-ssl-ciphers option to Configure.

关于python - SSL v3 握手失败(但仅在较新版本的 OpenSSL 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41584975/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com