cheroot.ssl package#
Submodules#
- cheroot.ssl.builtin module
BuiltinSSLAdapterBuiltinSSLAdapter.CERT_KEY_TO_ENVBuiltinSSLAdapter.CERT_KEY_TO_LDAP_CODEBuiltinSSLAdapter._abc_implBuiltinSSLAdapter._make_env_cert_dict()BuiltinSSLAdapter._make_env_dn_dict()BuiltinSSLAdapter._make_env_san_dict()BuiltinSSLAdapter.certificateBuiltinSSLAdapter.certificate_chainBuiltinSSLAdapter.ciphersBuiltinSSLAdapter.contextBuiltinSSLAdapter.get_environ()BuiltinSSLAdapter.makefile()BuiltinSSLAdapter.private_keyBuiltinSSLAdapter.private_key_passwordBuiltinSSLAdapter.wrap()
_assert_ssl_exc_contains()_loopback_for_cert()_loopback_for_cert_thread()_parse_cert()_sni_callback()
- cheroot.ssl.pyopenssl module
- Method One
- Method Two (shortcut)
SSLConnectionSSLConnection._decref_socketios()SSLConnection._socketSSLConnection.accept()SSLConnection.bind()SSLConnection.close()SSLConnection.connect()SSLConnection.connect_ex()SSLConnection.familySSLConnection.fileno()SSLConnection.get_app_data()SSLConnection.get_cipher_list()SSLConnection.get_context()SSLConnection.get_peer_certificate()SSLConnection.getpeername()SSLConnection.getsockname()SSLConnection.getsockopt()SSLConnection.gettimeout()SSLConnection.listen()SSLConnection.makefile()SSLConnection.pending()SSLConnection.read()SSLConnection.recv()SSLConnection.recv_into()SSLConnection.renegotiate()SSLConnection.send()SSLConnection.sendall()SSLConnection.set_accept_state()SSLConnection.set_app_data()SSLConnection.set_connect_state()SSLConnection.setblocking()SSLConnection.setsockopt()SSLConnection.settimeout()SSLConnection.shutdown()SSLConnection.sock_shutdown()SSLConnection.state_string()SSLConnection.want_read()SSLConnection.want_write()SSLConnection.write()
SSLConnectionProxyMetaSSLFileobjectMixinSSLFileobjectStreamReaderSSLFileobjectStreamWriterpyOpenSSLAdapterpyOpenSSLAdapter._abc_implpyOpenSSLAdapter._password_callback()pyOpenSSLAdapter.certificatepyOpenSSLAdapter.certificate_chainpyOpenSSLAdapter.cipherspyOpenSSLAdapter.contextpyOpenSSLAdapter.get_context()pyOpenSSLAdapter.get_environ()pyOpenSSLAdapter.makefile()pyOpenSSLAdapter.private_keypyOpenSSLAdapter.private_key_passwordpyOpenSSLAdapter.wrap()
Module contents#
Implementation of the SSL adapter base interface.
- class cheroot.ssl.Adapter(certificate, private_key, certificate_chain=None, ciphers=None, *, private_key_password=None)#
Bases:
ABCBase class for SSL driver library adapters.
Required methods:
wrap(sock) -> (wrapped socket, ssl environ dict)makefile(sock, mode='r', bufsize=DEFAULT_BUFFER_SIZE) -> socket file object
- _abc_impl = <_abc._abc_data object>#
- bind(sock)#
Return the given socket.
Deprecated: This method no longer performs any SSL-specific operations. SSL wrapping now happens in
wrap().bind()will be removed in a future version.
- abstract get_environ()#
Return WSGI environ entries to be merged into each request.
- abstract makefile(sock, mode='r', bufsize=-1)#
Return socket file object.
- abstract wrap(sock)#
Wrap the given socket and return WSGI environ entries.
- cheroot.ssl._ensure_peer_speaks_https(raw_socket, /) None#
Raise exception if the client sent plain HTTP.
This method probes the TCP stream for signs of the peer having sent us plaintext HTTP on the HTTPS port by peeking at the first bytes. If there’s no data yet, the method considers the guess inconclusive and does not error out. This allows the server to continue until the SSL handshake is attempted, at which point an error will be caught by the SSL layer if the client is not speaking TLS.
- Raises:
NoSSLError – When plaintext HTTP is detected on an HTTPS socket