I'm using the following configuration with pserve to use CherryPy's WSGI server:
use = egg:pyramid#cherrypy
host = 127.0.0.1
port = 443
ssl_pem = host.pem
This works, but it uses HTTP instead of HTTPS. I've found a problem with this line in cherrypy_server_runner():
server.ssl_certificate = server.ssl_private_key = ssl_pem
I'm using Python 3.3 and CherryPy 3.2.2. According to https://bitbucket.org/cherrypy/cherrypy/wiki/WhatsNewIn32, Python 3 support was introduced in CherryPy 3.2 and it uses a different way to configure SSL. Changing the above line to the following works and requests are served over HTTPS:
if ssl_pem is not None:
server.ssl_adapter = wsgiserver.ssl_builtin.BuiltinSSLAdapter(ssl_pem, ssl_pem)
Looks like the ssl_certificate and ssl_private_key attributes are now deprecated.
This has been fized in #1086
backport for #718 to 1.4-branch
Make ``pserve.cherrypy_server_runner`` Python 3 compatible.