returns immediately.
.. coroutinemethod:: start_tls(sslcontext, \*, server_hostname=None, \
- ssl_handshake_timeout=None)
+ ssl_handshake_timeout=None, ssl_shutdown_timeout=None)
Upgrade an existing stream-based connection to TLS.
handshake to complete before aborting the connection. ``60.0`` seconds
if ``None`` (default).
+ * *ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown
+ to complete before aborting the connection. ``30.0`` seconds if ``None``
+ (default).
+
.. versionadded:: 3.11
+ .. versionchanged:: 3.12
+ Added the *ssl_shutdown_timeout* parameter.
+
+
.. method:: is_closing()
Return ``True`` if the stream is closed or in the process of
async def start_tls(self, sslcontext, *,
server_hostname=None,
- ssl_handshake_timeout=None):
+ ssl_handshake_timeout=None,
+ ssl_shutdown_timeout=None):
"""Upgrade an existing stream-based connection to TLS."""
server_side = self._protocol._client_connected_cb is not None
protocol = self._protocol
new_transport = await self._loop.start_tls( # type: ignore
self._transport, protocol, sslcontext,
server_side=server_side, server_hostname=server_hostname,
- ssl_handshake_timeout=ssl_handshake_timeout)
+ ssl_handshake_timeout=ssl_handshake_timeout,
+ ssl_shutdown_timeout=ssl_shutdown_timeout)
self._transport = new_transport
protocol._replace_writer(self)