【原创】python Reuqests&nbs…

来源:互联网 发布:卖衣服的淘宝店 编辑:程序博客网 时间:2024/05/29 11:31
Python requests 模拟https请求报错:
c:\Python27\lib\site-packages\requests-2.6.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:79:InsecurePlatformWarning: A true SSLContextobject is not available. This prevents urllib3 fromconfiguring SSL appropriately and may cause certain SSL connectionsto fail. For more information, seehttps://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

解决办法:

一、取消使用SSL验证。 requests.get("https://www.baidu.com",verify=False)
二、安装openssl第三方库
easy_install requests[security]  pyopenssl ndg-httpsclient pyasn1 
如果是Ubuntu或者树莓派可能需要安装系统依赖
apt-get install libffi-dev libssl-dev
http://stackoverflow.com/questions/29134512/insecureplatformwarning-a-true-sslcontext-object-is-not-available-this-prevent
0 0
原创粉丝点击