尝试ssl.PROTOCOL_TLSv1_2使用Python 2.X来发出TLS1.2 HTTPS请求.
在这个线程(在Python 2.6中发送TLS 1.2请求)中建议我需要从Python 2.7.6切换到2.7.10,然后使用该ssl库.
不幸的是,在切换到Python 2.7.10之后,我无法访问 ssl.PROTOCOL_TLSv1_2(显然我无法发布图像).
我很确定我使用的是Python 2.7.10,因为当我激活我的虚拟环境并从命令行调用Python时,我看到:
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
我想也许问题是ssl图书馆已经过时了,这就是我在尝试时所看到的pip install ssl --upgrade
Collecting ssl
Using cached ssl-1.16.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/xl/nl55_c357zd2gqs09wfwytvh0000gn/T/pip-build-tn97bV/ssl/setup.py", line 12, in …
python-2.7 ×1