【发布时间】:2015-08-30 02:33:23
【问题描述】:
这是SSLError using requests for python的后续行动:
我刚刚在 Mac OSX 10.8.5 上安装了requests。我第一次尝试requests.get 因缺少证书而失败:
SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
上面的帖子说要查找
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/cacert.pem,但实际上我什至没有.../site-packages/requests目录。我不清楚这是否应该由安装添加(我使用了pip)-
更多线程和
requests文档说要安装certifi,所以我做到了。但现在我得到一个不同的错误:python -c 'import requests; requests.get("https://api.github.com/events")' /usr/lib/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Traceback (most recent call last): ... File "/usr/lib/anaconda/lib/python2.7/site-packages/requests/adapters.py", line 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm
谢谢!
【问题讨论】:
-
您的问题是什么?您需要明确说明您希望社区帮助您解决的问题。
-
这种错误在较旧的 OpenSSL 版本和使用 SHA-256 签名的证书中很常见。您使用的是哪个版本的 OpenSSL (
openssl version)? -
OpenSSL 0.9.8y 5 Feb 2013
标签: python macos ssl python-requests