mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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)
This commit is contained in:
parent
a8eb58546b
commit
9602643120
8 changed files with 258 additions and 72 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue