Source

CherryPy Recipes / deployment / tls / single_ssl_server.py

# -*- coding: utf-8 -*-
import cherrypy

class Root(object):
    @cherrypy.expose
    def index(self):
        return "hello world using: %s" % cherrypy.request.scheme

if __name__ == '__main__':
    cherrypy.config.update({'server.socket_port': 8090,
                            'server.ssl_certificate': './server.crt',
                            'server.ssl_private_key': './server.key'})
    cherrypy.quickstart(Root())