I had the same problem and managed to solve it based on the Code posted
here.
Apparently, you import the wsgi module from cheroot and then create a new server adapter (extending the ServerAdapter Baseclass in bottlepy). This class can then be passed as the "server" parameter to the normal bottlepy run() function. Here is my code. I currently do not use the SSL Features.
from bottle import debug, run, ServerAdapter
from cheroot import wsgi
from cheroot.ssl.builtin import BuiltinSSLAdapter
# Server implementation and interplay with bottlepy based on
# https://github.com/nickbabcock/bottle-ssl/blob/master/main.py
class SSLCherryPyServer(ServerAdapter):
def run(self, handler):
server = wsgi.Server((self.host, self.port), handler)
#server.ssl_adapter = BuiltinSSLAdapter('cacert.pem', 'privkey.pem')
# By default, the server will allow negotiations with extremely old protocols
# that are susceptible to attacks, so we only allow TLSv1.2
#server.ssl_adapter.context.options |= ssl.OP_NO_TLSv1
#server.ssl_adapter.context.options |= ssl.OP_NO_TLSv1_1
try:
server.start()
finally:
server.stop()
debug(True)
if __name__ == '__main__':
port = int(os.environ.get("PORT", 8080))
run(app, reloader=True, host='0.0.0.0', port=port, server=SSLCherryPyServer)