0

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.

mikeb
  • 10,578
  • 7
  • 62
  • 120
  • Which version of CherryPy are you using? – Bruno Jan 13 '15 at 01:41
  • cherrypy.__version__ is 3.6.0 – mikeb Jan 13 '15 at 01:48
  • You're probably facing the problem described in [this bug](https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working). The latest comments indicate the bug has been fixed, but there hasn't been a new release yet. I'd suggest to downgrade to 3.2.4 if you can. – Bruno Jan 13 '15 at 02:00
  • (I've closed this question as a duplicate, feel free to ask me or others to re-open if you feel this isn't the same problem.) – Bruno Jan 13 '15 at 02:01

0 Answers0