cheroot.ssl.builtin module

A library for integrating Python’s builtin ssl library with Cheroot.

The ssl module must be importable for SSL functionality.

To use this module, set HTTPServer.ssl_adapter to an instance of BuiltinSSLAdapter.

class cheroot.ssl.builtin.BuiltinSSLAdapter(certificate, private_key, certificate_chain=None, ciphers=None)

Bases: cheroot.ssl.Adapter

A wrapper for integrating Python’s builtin ssl module with Cheroot.

CERT_KEY_TO_ENV = {'issuer': 'SSL_CLIENT_I_DN', 'subject': 'SSL_CLIENT_S_DN'}
CERT_KEY_TO_LDAP_CODE = {'commonName': 'CN', 'countryName': 'C', 'emailAddress': 'Email', 'localityName': 'L', 'organizationName': 'O', 'organizationalUnitName': 'OU', 'stateOrProvinceName': 'ST'}
bind(sock)

Wrap and return the given socket.

certificate = None

The filename of the server SSL certificate.

certificate_chain = None

The filename of the certificate chain file.

ciphers = None

The ciphers list of SSL.

context = None

The ssl.SSLContext that will be used to wrap sockets.

env_dn_dict(env_prefix, cert_value)

Return a dict of WSGI environment variables for a client cert DN.

E.g. SSL_CLIENT_S_DN_CN, SSL_CLIENT_S_DN_C, etc. See SSL_CLIENT_S_DN_x509 at https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#envvars.

get_environ(sock)

Create WSGI environ entries to be merged into each request.

makefile(sock, mode='r', bufsize=8192)

Return socket file object.

private_key = None

The filename of the server’s private key file.

wrap(sock)

Wrap and return the given socket, plus WSGI environ entries.

Indices and tables