SNIMissingWarning和InsecurePlatformWarning警告

来源:互联网 发布:chrome浏览器 知乎 编辑:程序博客网 时间:2024/05/16 14:40

在爬取weibo.com等动态网站时,pycharm在运行时会提出SNIMissingWarning和InsecurePlatformWarning警告

详细警告内容如下:

 

 D:\Python2.7.6\lib\site-packages\requests\packages\urllib3\util\ssl_.py:315: 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.   SNIMissingWarning
D:\Python2.7.6\lib\site-packages\requests\packages\urllib3\util\ssl_.py:120: 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 
 
解决方法:
在DOS窗口中输入:
pip install pyopenssl ndg-httpsclient pyasn1
阅读全文
0 0
原创粉丝点击