I'm having trouble getting ssl working with CherryPY and my bottle app, here is my latest try at it:
class SSLCherryPyServer(bottle.ServerAdapter):
def run(self, handler):
from cherrypy import wsgiserver
from cherrypy.wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter
server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler)
ssl_cert = "/etc/garage/pi.olympus.key"
ssl_key = "/etc/garage/pi.olympus.crt"
server.ssl_adapter = pyOpenSSLAdapter(ssl_key, ssl_cert)
try:
server.start()
finally:
server.stop()
app = bottle.app()
#bottle.run(app=app, host='pi.olympus', port=8080, debug=True)
bottle.run(app=app, host='pi.olympus', port=8080, debug=True, server=SSLCherryPyServer)
I can access the server at http://pi.olympus:8080
, but not with https on that or any port. I use netstat and it does not look like any other port is listening.
Edit: Cherrypy is 3.6.0
What have I got wrong? Not that it matters this is on Ubuntu on a Raspberry PI.