diff options
author | Yury Selivanov <yury@magic.io> | 2018-06-04 11:32:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-04 11:32:35 -0400 |
commit | 9602643120a509858d0bee4215d7f150e6125468 (patch) | |
tree | 43f875c7a1437f958994c7f2a3c281c45f8e3d5d /Lib/test/test_asyncio/utils.py | |
parent | a8eb58546b37a7cd5f332f019bb07388f5212c2d (diff) | |
download | cpython-9602643120a509858d0bee4215d7f150e6125468.tar.gz cpython-9602643120a509858d0bee4215d7f150e6125468.zip |
bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)
* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
Diffstat (limited to 'Lib/test/test_asyncio/utils.py')
-rw-r--r-- | Lib/test/test_asyncio/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index 96dfe2f85b4..5362591b5d7 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -77,10 +77,11 @@ def simple_server_sslcontext(): return server_context -def simple_client_sslcontext(): +def simple_client_sslcontext(*, disable_verify=True): client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) client_context.check_hostname = False - client_context.verify_mode = ssl.CERT_NONE + if disable_verify: + client_context.verify_mode = ssl.CERT_NONE return client_context |