diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-02-15 13:04:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 13:04:00 (GMT) |
commit | 13c10bfb777483c7b02877aab029345a056b809c (patch) | |
tree | 4a94952a81baef1c7ceef4edc5f5d5cc6e33e2e9 /Lib/asyncio/events.py | |
parent | 3be1a443ca8e7d4ba85f95b78df5c4122cae9ede (diff) | |
download | cpython-13c10bfb777483c7b02877aab029345a056b809c.zip cpython-13c10bfb777483c7b02877aab029345a056b809c.tar.gz cpython-13c10bfb777483c7b02877aab029345a056b809c.tar.bz2 |
bpo-44011: New asyncio ssl implementation (#31275)
* bpo-44011: New asyncio ssl implementation
Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com>
* fix warning
* fix typo
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r-- | Lib/asyncio/events.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index e3c55b2..1d305e3 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -303,6 +303,7 @@ class AbstractEventLoop: flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, + ssl_shutdown_timeout=None, happy_eyeballs_delay=None, interleave=None): raise NotImplementedError @@ -312,6 +313,7 @@ class AbstractEventLoop: flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None, reuse_port=None, ssl_handshake_timeout=None, + ssl_shutdown_timeout=None, start_serving=True): """A coroutine which creates a TCP server bound to host and port. @@ -352,6 +354,10 @@ class AbstractEventLoop: will wait for completion of the SSL handshake before aborting the connection. Default is 60s. + ssl_shutdown_timeout is the time in seconds that an SSL server + will wait for completion of the SSL shutdown procedure + before aborting the connection. Default is 30s. + start_serving set to True (default) causes the created server to start accepting connections immediately. When set to False, the user should await Server.start_serving() or Server.serve_forever() @@ -370,7 +376,8 @@ class AbstractEventLoop: async def start_tls(self, transport, protocol, sslcontext, *, server_side=False, server_hostname=None, - ssl_handshake_timeout=None): + ssl_handshake_timeout=None, + ssl_shutdown_timeout=None): """Upgrade a transport to TLS. Return a new transport that *protocol* should start using @@ -382,13 +389,15 @@ class AbstractEventLoop: self, protocol_factory, path=None, *, ssl=None, sock=None, server_hostname=None, - ssl_handshake_timeout=None): + ssl_handshake_timeout=None, + ssl_shutdown_timeout=None): raise NotImplementedError async def create_unix_server( self, protocol_factory, path=None, *, sock=None, backlog=100, ssl=None, ssl_handshake_timeout=None, + ssl_shutdown_timeout=None, start_serving=True): """A coroutine which creates a UNIX Domain Socket server. @@ -410,6 +419,9 @@ class AbstractEventLoop: ssl_handshake_timeout is the time in seconds that an SSL server will wait for the SSL handshake to complete (defaults to 60s). + ssl_shutdown_timeout is the time in seconds that an SSL server + will wait for the SSL shutdown to finish (defaults to 30s). + start_serving set to True (default) causes the created server to start accepting connections immediately. When set to False, the user should await Server.start_serving() or Server.serve_forever() @@ -420,7 +432,8 @@ class AbstractEventLoop: async def connect_accepted_socket( self, protocol_factory, sock, *, ssl=None, - ssl_handshake_timeout=None): + ssl_handshake_timeout=None, + ssl_shutdown_timeout=None): """Handle an accepted connection. This is used by servers that accept connections outside of |