web.web.wsgiserver.ssl_pyopenssl

Package web :: Package web :: Package wsgiserver :: Module ssl_pyopenssl |
[hide private]
[frames] | no frames]

# Module ssl_pyopenssl

source code

    A library for integrating pyOpenSSL with CherryPy.

    The OpenSSL module must be importable for SSL functionality.
    You can obtain it from http://pyopenssl.sourceforge.net/

    To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
    SSLAdapter. There are two ways to use SSL:

    Method One:
        ssl_adapter.context: an instance of SSL.Context.

        If this is not None, it is assumed to be an SSL.Context instance,
        and will be passed to SSL.Connection on bind(). The developer is
        responsible for forming a valid Context object. This approach is
        to be preferred for more flexibility, e.g. if the cert and key are
        streams instead of files, or need decryption, or SSL.SSLv3_METHOD
        is desired instead of the default SSL.SSLv23_METHOD, etc. Consult
        the pyOpenSSL documentation for complete options.

    Method Two (shortcut):
        ssl_adapter.certificate: the filename of the server SSL certificate.
        ssl_adapter.private_key: the filename of the server's private key file.

        Both are None by default. If ssl_adapter.context is None, but .private_key
        and .certificate are both given and valid, they will be read, and the
        context will be automatically created from them.

        ssl_adapter.certificate_chain: (optional) the filename of CA's intermediate
            certificate bundle. This is needed for cheaper "chained root" SSL
            certificates, and should be left as None if not required.

Classes | [hide private]
| SSL_fileobject SSL file object attached to a socket object.
| SSLConnection A thread-safe wrapper for an SSL.Connection.
| pyOpenSSLAdapter A wrapper for integrating pyOpenSSL with CherryPy.

Variables | [hide private]
| SSL = `None` hash(x)