Commits

Sylvain Hellegouarch  committed 64b3bf0

wsgi and ssl using CherryPy

  • Participants
  • Parent commits 026034f

Comments (0)

Files changed (1)

File deployment/tls/wsgi_ssl_server.py

+# -*- 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()