4

解决SSL InsecurePlatformWarning问题

 2 years ago
source link: https://www.hi-roy.com/posts/%E8%A7%A3%E5%86%B3ssl-insecureplatformwarning%E9%97%AE%E9%A2%98/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

解决SSL InsecurePlatformWarning问题

2015-10-13

最近使用requests库进行操作时总出现如下警告:

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.

虽然不影响程序执行,不过看着一个警告还是心理不舒服.

解决办法很简单,安装几个包即可pip install pyopenssl ndg-httpsclient pyasn1

安装过程中可能出现某些头文件不存在的错误,比如

openssl/aes.h: No such file or directory
fatal error: ffi.h: No such file or directory

安装对应的dev包即可,比如ubuntu下就是 sudo apt-get install libffi-dev libssl-dev

Roy avatar
About Roy
野生程序猿,略懂Python,略懂Golang,略懂云计算,略懂大数据,略懂拳击游泳钓鱼,略懂钢琴吉他摄影。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK