Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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())


Expand Down Expand Up @@ -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
Expand Down
Loading