根据解决requests
中的问题的建议
Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:645)SSLErrorEOF occurred in violation of protocol
我可以做一些事情:
class MyAdapter(HTTPAdapter):
def init_poolmanager(self, connections, maxsize, block=False, **pool_kwargs):
self.poolmanager = PoolManager(
num_pools=connections,
maxsize=maxsize,
block=block,
ssl_version=ssl.PROTOCOL_TLSv1
)
# then
import requests
s=requests.session()
s.mount("https://", MyAdapter)
如何使用aiohttp
做同样的事情?
答案 0 :(得分:2)
ssl_context 是您可以使用的字段。检查一下: