解决python安装模块出现SNIMissingWarning和InsecurePlatformWarning警告

用pip安装任何模块都出现在想要获取https站点的资源时,会报出SNIMissingWarning和InsecurePlatformWarning警告

SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform.This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarningA 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

原因是别人不信任你 说你的SSL有问题

网上都说用pip安装下面的库

pip install pyopenssl ndg-httpsclient pyasn1

但是安装任何模块都不行怎么去安装?

然后我的原因在于为了抓包再IE里安装了burp证,导致证书不信任,把证书删除后即可解决问题。

然后网络又不好,换源完美解决

1.找到本机User目录下的应用程序文件存放目录appdata,找到pip文件夹 ,我的路径是C:\Users\Money\AppData\Local\pip

2.新建一个文件pip.ini:

[global] timeout = 6000

index-url = http://pypi.douban.com/simple

trusted-host = http://pypi.douban.com

OK 耗费了我两个小时解决这个问题

你可能感兴趣的:(解决python安装模块出现SNIMissingWarning和InsecurePlatformWarning警告)