Skip to content

Commit 9ed2a41

Browse files
committed
Add thread-safety clarifications to the SSLContext documentation
1 parent 42351c3 commit 9ed2a41

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Doc/library/ssl.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,19 @@ to speed up repeated connections from the same clients.
14721472
:data:`PROTOCOL_TLS`, :data:`PROTOCOL_TLS_CLIENT`, and
14731473
:data:`PROTOCOL_TLS_SERVER` use TLS 1.2 as minimum TLS version.
14741474

1475+
.. note::
1476+
1477+
:class:`SSLContext` only supports limited mutation once it has been used
1478+
by a connection. Adding new certificates to the internal trust store is
1479+
allowed, but changing ciphers, verification settings, or mTLS
1480+
certificates may result in surprising behavior.
1481+
1482+
.. note::
1483+
1484+
:class:`SSLContext` is designed to be shared and used by multiple
1485+
connections.
1486+
Thus, it is thread-safe as long as it is not reconfigured after being
1487+
used by a connection.
14751488

14761489
:class:`SSLContext` objects have the following methods and attributes:
14771490

0 commit comments

Comments
 (0)