关闭

ubuntu InsecurePlatformWarning:

244人阅读 评论(0) 收藏 举报
分类:

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


answer:Did you read the link (urllib3.readthedocs.org/en/latest/…)? It gives two suggestions: either upgrade to at least Python 2.7.9 or use pyOpenSSL.

The docs give a fair indicator of what's required., however requests allow us to skip a few steps:

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

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:21833次
    • 积分:470
    • 等级:
    • 排名:千里之外
    • 原创:24篇
    • 转载:13篇
    • 译文:0篇
    • 评论:3条
    最新评论