使用特定网站的Python 3.5中的此基本代码段会失败,并显示requests.exceptions.SSLError:[SSL:SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3警报握手失败(_ssl.c:720)

import requests

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

它在Ubuntu 16.04上运行良好,但在Debian Stretch上具有完全相同版本的所有Python依赖项的脚本完全相同.

我试过安装requests [security],没有任何区别.

我的安装之间唯一显着的区别是Debian的OpenSSL 1.1.0c 2016年11月10日和Ubuntu的版本OpenSSL 1.0.2g 2016年3月1日.

不知何故,新版本的OpenSSL必须导致它失败.

使用的请求版本为2.11.1.

解决方法:

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

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,python-3-x,ssl,openssl,python-requests

来源: https://codeday.me/bug/20191009/1877592.html

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐