【发布时间】:2013-10-28 22:09:59
【问题描述】:
我正在尝试使用 SNI 从托管在 Google App Engine 上的网站下载 HTTPS 页面。 无论我使用什么库,我都会收到以下错误:
[Errno 8] _ssl.c:504: EOF occurred in violation of protocol
我尝试了多种方式解决该错误,包括使用 urllib3 openssl monkeypatch:
from urllib3.contrib import pyopenssl
pyopenssl.inject_into_urllib3
但我总是遇到上述相同的错误。
有什么想法吗?
【问题讨论】:
-
不确定这是否是您问题中的拼写错误,但该行应该是
pyopenssl.inject_into_urllib3()— 也就是说,它是函数调用,而不是属性访问。 -
你完全正确!我的愚蠢错误..经过测试并有效,谢谢:)
标签: python google-app-engine sni urllib3