您的足迹:首页 > 语言程序 >Python出现错误SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform.

Python出现错误SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform.

之前写的python京东自动签到一直运行的很稳定个,但是最近在查看日志的时候发现在获取https站点的资源时,会报出SNIMissingWarning和InsecurePlatformWarning警告,导致签到不成功。具体错误如下:

/usr/local/lib/python2.7/site-packages/requests-2.11.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:318: 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. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/site-packages/requests-2.11.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

 

解决方法:

 

在cmd中输入:

pip install pyopenssl ndg-httpsclient pyasn1


相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)