def run(self, server_handler):
"""
Overrides super to setup Cherry py with ssl and start the server.
:param server_handler: originating server type
:type server_handler:
"""
server = wsgiserver.CherryPyWSGIServer((self.host, self.port), server_handler)
# Uses the following github page's recommendation for setting up the cert:
# https://github.com/nickbabcock/bottle-ssl
server.ssl_adapter = ssl_builtin.BuiltinSSLAdapter(conf_obj['ssl']['cacert_pem_path'],
conf_obj['ssl']['privkey_pem_path'])
try:
server.start()
finally:
server.stop()
评论列表
文章目录