@@ -141,13 +141,16 @@ instead.
141141
142142 Takes an instance ``sock `` of :class: `socket.socket `, and returns an instance
143143 of :class: `ssl.SSLSocket `, a subtype of :class: `socket.socket `, which wraps
144- the underlying socket in an SSL context. For client-side sockets, the
145- context construction is lazy; if the underlying socket isn't connected yet,
146- the context construction will be performed after :meth: `connect ` is called on
147- the socket. For server-side sockets, if the socket has no remote peer, it is
148- assumed to be a listening socket, and the server-side SSL wrapping is
149- automatically performed on client connections accepted via the :meth: `accept `
150- method. :func: `wrap_socket ` may raise :exc: `SSLError `.
144+ the underlying socket in an SSL context. ``sock `` must be a
145+ :data: `~socket.SOCK_STREAM ` socket; other socket types are unsupported.
146+
147+ For client-side sockets, the context construction is lazy; if the
148+ underlying socket isn't connected yet, the context construction will be
149+ performed after :meth: `connect ` is called on the socket. For
150+ server-side sockets, if the socket has no remote peer, it is assumed
151+ to be a listening socket, and the server-side SSL wrapping is
152+ automatically performed on client connections accepted via the
153+ :meth: `accept ` method. :func: `wrap_socket ` may raise :exc: `SSLError `.
151154
152155 The ``keyfile `` and ``certfile `` parameters specify optional files which
153156 contain a certificate to be used to identify the local side of the
@@ -836,7 +839,10 @@ to speed up repeated connections from the same clients.
836839 server_hostname=None)
837840
838841 Wrap an existing Python socket *sock * and return an :class: `SSLSocket `
839- object. The SSL socket is tied to the context, its settings and
842+ object. *sock * must be a :data: `~socket.SOCK_STREAM ` socket; other socket
843+ types are unsupported.
844+
845+ The returned SSL socket is tied to the context, its settings and
840846 certificates. The parameters *server_side *, *do_handshake_on_connect *
841847 and *suppress_ragged_eofs * have the same meaning as in the top-level
842848 :func: `wrap_socket ` function.
0 commit comments