python SNIMissingWarning InsecurePlatformWarning

在python2.7.6 下使用requests进行爬网络数据时,遇到问题:

问题:

C:\Python2.7\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

C:\Python2.7\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

解决办法:

pip install pyopenssl ndg-httpsclient pyasn1

参考

http://blog.csdn.net/Alex_X_Jane/article/details/51146537

你可能感兴趣的:(python)