Skip to content

Instantly share code, notes, and snippets.

@kisielk
Created September 18, 2011 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kisielk/1224571 to your computer and use it in GitHub Desktop.
Save kisielk/1224571 to your computer and use it in GitHub Desktop.
Testing SSL functionality in tornado
import tornado.web
import tornado.httpserver
import tornado.ioloop
class DefaultHandler(tornado.web.RequestHandler):
def get(self):
self.write("Nothing to see here\n")
if __name__ == "__main__":
app = tornado.web.Application([
(r"/", DefaultHandler),
# (r"/RPC2", MainHandler, dict(core=core))
])
ssl_options = {'certfile': '/home/kamil/code/bcfg2-repo/bcfg2.crt',
'keyfile': '/home/kamil/code/bcfg2-repo/bcfg2.key',
}
server = tornado.httpserver.HTTPServer(app, ssl_options)
server.listen(6790)
tornado.ioloop.IOLoop.instance().set_blocking_log_threshold(0.5)
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment