summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/asyncio-stream.rst18
-rw-r--r--Doc/whatsnew/3.11.rst4
2 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index ba534f9..72355d3 100644
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -295,6 +295,24 @@ StreamWriter
be resumed. When there is nothing to wait for, the :meth:`drain`
returns immediately.
+ .. coroutinemethod:: start_tls(sslcontext, \*, server_hostname=None, \
+ ssl_handshake_timeout=None)
+
+ Upgrade an existing stream-based connection to TLS.
+
+ Parameters:
+
+ * *sslcontext*: a configured instance of :class:`~ssl.SSLContext`.
+
+ * *server_hostname*: sets or overrides the host name that the target
+ server's certificate will be matched against.
+
+ * *ssl_handshake_timeout* is the time in seconds to wait for the TLS
+ handshake to complete before aborting the connection. ``60.0`` seconds
+ if ``None`` (default).
+
+ .. versionadded:: 3.8
+
.. method:: is_closing()
Return ``True`` if the stream is closed or in the process of
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index dba554c..9f7f6f5 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -246,6 +246,10 @@ asyncio
:meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
(Contributed by Alex Grönholm in :issue:`46805`.)
+* Add :meth:`~asyncio.streams.StreamWriter.start_tls` method for upgrading
+ existing stream-based connections to TLS. (Contributed by Ian Good in
+ :issue:`34975`.)
+
fractions
---------