class ssl.SSLSocket(socket.socket)
SSL sockets provide the following methods of Socket Objects:
accept()
bind()
close()
connect()
detach()
fileno()
-
getpeername()
,getsockname()
-
getsockopt()
,setsockopt()
-
gettimeout()
,settimeout()
,setblocking()
listen()
makefile()
-
recv()
,recv_into()
(but passing a non-zeroflags
argument is not allowed) -
send()
,sendall()
(with the same limitation) -
sendfile()
(butos.sendfile
will be used for plain-text sockets only, elsesend()
will be used) shutdown()
However, since the SSL (and TLS) protocol has its own framing atop of TCP, the SSL sockets abstraction can, in certain respects, diverge from the specification of normal, OS-level sockets. See especially the notes on non-blocking sockets.
Usually, SSLSocket
are not created directly, but using the wrap_socket()
function or the SSLContext.wrap_socket()
method.
Changed in version 3.5: The sendfile()
method was added.
Changed in version 3.5: The shutdown()
does not reset the socket timeout each time bytes are received or sent. The socket timeout is now to maximum total duration of the shutdown.
Please login to continue.