My Project
Loading...
Searching...
No Matches
wolfssl.SSLSocket Class Reference
Inheritance diagram for wolfssl.SSLSocket:

Public Member Functions

 __init__ (self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_TLS, ca_certs=None, do_handshake_on_connect=True, family=AF_INET, sock_type=SOCK_STREAM, proto=0, fileno=None, suppress_ragged_eofs=True, ciphers=None, _context=None)
 
 __del__ (self)
 
 context (self)
 
 dup (self)
 
 write (self, data)
 
 send (self, data, flags=0)
 
 sendall (self, data, flags=0)
 
 sendto (self, data, flags_or_addr, addr=None)
 
 sendmsg (self, *args, **kwargs)
 
 sendfile (self, file, offset=0, count=None)
 
 read (self, length=1024, buffer=None)
 
 recv (self, length=1024, flags=0)
 
 recv_into (self, buffer, nbytes=None, flags=0)
 
 recvfrom (self, length=1024, flags=0)
 
 recvfrom_into (self, buffer, nbytes=None, flags=0)
 
 recvmsg (self, *args, **kwargs)
 
 recvmsg_into (self, *args, **kwargs)
 
 shutdown (self, how)
 
 unwrap (self)
 
 do_handshake (self, block=False)
 
 connect (self, addr)
 
 connect_ex (self, addr)
 
 accept (self)
 

Data Fields

 do_handshake_on_connect = do_handshake_on_connect
 
 suppress_ragged_eofs = suppress_ragged_eofs
 
 server_side = server_side
 
 keyfile = keyfile
 
 certfile = certfile
 
 cert_reqs = cert_reqs
 
 ssl_version = ssl_version
 
 ca_certs = ca_certs
 
 ciphers = ciphers
 
 native_object = _lib.wolfSSL_new(self.context.native_object)
 

Protected Member Functions

 _release_native_object (self)
 
 _check_closed (self, call=None)
 
 _check_connected (self)
 
 _real_connect (self, addr, connect_ex)
 

Protected Attributes

 _context = _context
 
bool _closed = False
 
bool _connected = connected
 

Detailed Description

This class implements a subtype of socket.socket that wraps the
underlying OS socket in an SSL/TLS connection, providing secure
read and write methods over that channel.

Member Function Documentation

◆ accept()

wolfssl.SSLSocket.accept ( self)
Accepts a new connection from a remote client, and returns a tuple
containing that new connection wrapped with a server-side secure
channel, and the address of the remote client.

◆ connect()

wolfssl.SSLSocket.connect ( self,
addr )
Connects to remote ADDR, and then wraps the connection in a secure
channel.

◆ connect_ex()

wolfssl.SSLSocket.connect_ex ( self,
addr )
Connects to remote ADDR, and then wraps the connection in a secure
channel.

◆ context()

wolfssl.SSLSocket.context ( self)
Returns the context used by this object.

◆ do_handshake()

wolfssl.SSLSocket.do_handshake ( self,
block = False )
Perform a TLS/SSL handshake.

◆ read()

wolfssl.SSLSocket.read ( self,
length = 1024,
buffer = None )
Read up to LENGTH bytes and return them.
Return zero-length string on EOF.

◆ unwrap()

wolfssl.SSLSocket.unwrap ( self)
Unwraps the underlying OS socket from the SSL/TLS connection.
Returns the wrapped OS socket.

◆ write()

wolfssl.SSLSocket.write ( self,
data )
Write DATA to the underlying secure channel.
Returns number of bytes of DATA actually transmitted.