Public Member Functions | Data Fields
wolfssl.SSLContext Class Reference
Inheritance diagram for wolfssl.SSLContext:

Public Member Functions

def __init__ (self, protocol, server_side=False)
 
def __del__ (self)
 
def verify_mode (self)
 
def verify_mode (self, value)
 
def wrap_socket (self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True)
 
def set_ciphers (self, ciphers)
 
def load_cert_chain (self, certfile, keyfile=None, password=None)
 
def load_verify_locations (self, cafile=None, capath=None, cadata=None)
 

Data Fields

 protocol
 
 native_object
 
 verify_mode
 

Detailed Description

An SSLContext holds various SSL-related configuration options and
data, such as certificates and possibly a private key.

Member Function Documentation

◆ load_cert_chain()

def wolfssl.SSLContext.load_cert_chain (   self,
  certfile,
  keyfile = None,
  password = None 
)
Load a private key and the corresponding certificate. The certfile
string must be the path to a single file in PEM format containing
the certificate as well as any number of CA certificates needed to
establish the certificate's authenticity.

The keyfile string, if present, must point to a file containing the
private key in.

The password parameter is not supported yet.

◆ load_verify_locations()

def wolfssl.SSLContext.load_verify_locations (   self,
  cafile = None,
  capath = None,
  cadata = None 
)
Load a set of "certification authority" (CA) certificates used to
validate other peers' certificates when verify_mode is other than
CERT_NONE. At least one of cafile or capath must be specified.

The cafile string, if present, is the path to a file of concatenated
CA certificates in PEM format.

The capath string, if present, is the path to a directory containing
several CA certificates in PEM format.

◆ set_ciphers()

def wolfssl.SSLContext.set_ciphers (   self,
  ciphers 
)
Set the available ciphers for sockets created with this context. It
should be a string in the wolfSSL cipher list format. If no cipher can
be selected (because compile-time options or other configuration forbids
use of all the specified ciphers), an SSLError will be raised.

◆ verify_mode()

def wolfssl.SSLContext.verify_mode (   self)
Whether to try to verify other peers’ certificates and how to behave
if verification fails. This attribute must be one of CERT_NONE,
CERT_OPTIONAL or CERT_REQUIRED.

◆ wrap_socket()

def wolfssl.SSLContext.wrap_socket (   self,
  sock,
  server_side = False,
  do_handshake_on_connect = True,
  suppress_ragged_eofs = True 
)
Wrap an existing Python socket sock and return an SSLSocket object.
sock must be a SOCK_STREAM socket; other socket types are unsupported.

The returned SSL socket is tied to the context, its settings and
certificates. The parameters server_side, do_handshake_on_connect and
suppress_ragged_eofs have the same meaning as in the top-level
wrap_socket() function.