urllib3 on python 2.7 SNI error on Google App Engine

别说谁变了你拦得住时间么 提交于 2019-11-29 07:39:57

Unfortunately for urllib3, the Python standard library did not add SNI support until Python 3.2. (See Issue #118 @ urllib3)

To use SNI in Python 2.7 with urllib3, you'll need to use the PyOpenSSL injection monkeypatch. (See Issue #156 @ urllib3)

from urllib3.contrib import pyopenssl
pyopenssl.inject_into_urllib3()

Your question basically had the same code, except it was missing the parentheses call on the pyopenssl.inject_into_urllib3() call. Fixing that should do the trick.

You'll also need to make sure to have the following dependencies available:

  • pyOpenSSL (tested with 0.13)
  • ndg-httpsclient (tested with 0.3.2)
  • pyasn1 (tested with 0.1.6)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!