How to create HTTPS tornado server
No need to use TCPServer
.
Try following:
import tornado.httpserverimport tornado.ioloopimport tornado.webclass getToken(tornado.web.RequestHandler): def get(self): self.write("hello")application = tornado.web.Application([ (r'/', getToken),])if __name__ == '__main__': http_server = tornado.httpserver.HTTPServer(application, ssl_options={ "certfile": "/var/pyTest/keys/ca.csr", "keyfile": "/var/pyTest/keys/ca.key", }) http_server.listen(443) tornado.ioloop.IOLoop.instance().start()