mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Keep asyncio working with Python 3.3 too.
This commit is contained in:
parent
085869bfee
commit
7fa6e1aeea
1 changed files with 9 additions and 2 deletions
|
|
@ -571,8 +571,15 @@ class _SelectorSslTransport(_SelectorTransport):
|
||||||
# context; in that case the sslcontext passed is None.
|
# context; in that case the sslcontext passed is None.
|
||||||
# The default is the same as used by urllib with
|
# The default is the same as used by urllib with
|
||||||
# cadefault=True.
|
# cadefault=True.
|
||||||
sslcontext = ssl._create_stdlib_context(
|
if hasattr(ssl, '_create_stdlib_context'):
|
||||||
cert_reqs=ssl.CERT_REQUIRED)
|
sslcontext = ssl._create_stdlib_context(
|
||||||
|
cert_reqs=ssl.CERT_REQUIRED)
|
||||||
|
else:
|
||||||
|
# Fallback for Python 3.3.
|
||||||
|
sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
|
||||||
|
sslcontext.options |= ssl.OP_NO_SSLv2
|
||||||
|
sslcontext.set_default_verify_paths()
|
||||||
|
sslcontext.verify_mode = ssl.CERT_REQUIRED
|
||||||
|
|
||||||
wrap_kwargs = {
|
wrap_kwargs = {
|
||||||
'server_side': server_side,
|
'server_side': server_side,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue