在python中,在Ubuntu服务器上,我试图让requests
库发出https请求,如下所示:
import requests
requests.post("https://example.com")
首先,我得到了以下信息:
/usr/local/lib/python2.7/dist-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: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately之后,我现在已将警告升级为以下错误:
AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'
我该怎么解决?
我的解决办法如下:
这使得python能够为我开发Ubuntu 12.04.3lts。
关于红帽:
相关问题 更多 >
编程相关推荐