https://github.com/python/cpython/commit/f112215dd7ef054655093e880384dbaed0fbfc66
commit: f112215dd7ef054655093e880384dbaed0fbfc66
branch: main
author: Damian Shaw <[email protected]>
committer: gpshead <[email protected]>
date: 2026-11-12T00:01:45Z
summary:
gh-161763: Correct SSL docs for unconnected client sockets (#GH-61772)
* gh-161763: Correct SSL docs for unconnected client sockets
* gh-161763: Qualify SSL socket method references
files:
M Doc/library/ssl.rst
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index d1c099bd77e47e..868ef066759743 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -101,6 +101,7 @@ Client socket example with custom context and IPv4::
with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock:
with context.wrap_socket(sock, server_hostname=hostname) as ssock:
+ ssock.connect((hostname, 443))
print(ssock.version())
@@ -2236,13 +2237,12 @@ to speed up repeated connections from the same clients.
The parameter ``server_side`` is a boolean which identifies whether
server-side or client-side behavior is desired from this socket.
- For client-side sockets, the context construction is lazy; if the
- underlying socket isn't connected yet, the context construction will be
- performed after :meth:`connect` is called on the socket. For
- server-side sockets, if the socket has no remote peer, it is assumed
+ For client-side sockets, if *sock* is not yet connected, the underlying
+ SSL object is created when :meth:`~socket.socket.connect` is called.
+ For server-side sockets, if the socket has no remote peer, it is assumed
to be a listening socket, and the server-side SSL wrapping is
automatically performed on client connections accepted via the
- :meth:`accept` method. The method may raise :exc:`SSLError`.
+ :meth:`~socket.socket.accept` method. The method may raise :exc:`SSLError`.
On client connections, the optional parameter *server_hostname* specifies
the hostname of the service which we are connecting to. This allows a
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]