Commits

flynsqrl  committed 369ca3d

Update to CherryPy WSGI server to use Python's builtin 'ssl' module.

  • Participants
  • Parent commits 814fbc4

Comments (0)

Files changed (1)

File paste/script/cherrypy_server.py

 """
 try:
     from cherrypy import wsgiserver
+    from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter
 except ImportError:
     print '=' * 60
     print '== You must install CherryPy (pip install cherrypy) to use the egg:PasteScript#cherrypy server'
 
     server = wsgiserver.CherryPyWSGIServer(bind_addr, app,
                                            server_name=server_name, **kwargs)
-    server.ssl_certificate = server.ssl_private_key = ssl_pem
+    if is_ssl:
+        server.ssl_module = 'builtin'
+        server.ssl_adapter = BuiltinSSLAdapter(ssl_pem, ssl_pem)
+        
     if protocol_version:
         server.protocol = protocol_version