-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Milestone
Description
Apparently it's fairly trivial to support SSL termination in Tornado, e.g. this works with a self-signed cert:
diff --git a/bokeh/server/server.py b/bokeh/server/server.py
index 04ce230e1..fb8a6e129 100644
--- a/bokeh/server/server.py
+++ b/bokeh/server/server.py
@@ -394,6 +394,10 @@ class Server(BaseServer):
websocket_max_message_size_bytes=opts.websocket_max_message_size,
**kwargs)
+ import ssl
+ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
+ context.load_cert_chain(certfile="/Users/bryan/tmp/ssl/cert.pem")
+ http_server_kwargs['ssl_options'] = context
http_server = HTTPServer(tornado_app, **http_server_kwargs)
http_server.start(opts.num_procs)
Propose to add server opts and corresponding command line args for certfile and (optionally) keyfile.