Source

CherryPy Recipes / deployment / tls / wsgi_ssl_server.py

Full commit
# -*- coding: utf-8 -*-
def my_app(environ, start_response):
    status = '200 OK'
    response_headers = [('Content-type','text/plain')]
    start_response(status, response_headers)
    return ['Hello world!']

if __name__ == '__main__':
    from cherrypy import wsgiserver
    from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter

    server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 8090), my_app)
    server.ssl_adapter = BuiltinSSLAdapter('./server.crt', './server.key')
    server.start()