码迷,mamicode.com
首页 > 编程语言 > 详细

python requests https 访问出错

时间:2015-12-16 12:24:11      阅读:430      评论:0      收藏:0      [点我收藏+]

标签:

错误提示:

/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:100: 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

 

解决办法:

You only need to install the security package extras (thanks @admdrew for pointing it out)

$ pip install requests[security]

or, install them directly:

$ pip install pyopenssl ndg-httpsclient pyasn1

Requests will then automatically inject pyopenssl into urllib3


If you‘re on ubuntu, you may run into trouble installing pyopenssl, you‘ll need these dependencies:

$ apt-get install libffi-dev libssl-dev

 

python requests https 访问出错

标签:

原文地址:http://www.cnblogs.com/nashiyue/p/5050585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!