From 3aa004e5c384ac88bb970027084d1d3d4670b475 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 26 Feb 2015 11:57:05 -0800 Subject: [PATCH] add ssl_options config value exposes more ssl config, such as ca_certs, disabling SSLv3, etc. --- IPython/html/notebookapp.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 9df60d121..536aee5bd 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -505,7 +505,11 @@ class NotebookApp(BaseIPythonApplication): tornado_settings = Dict(config=True, help="Supply overrides for the tornado.web.Application that the " "IPython notebook uses.") - + + ssl_options = Dict(config=True, + help="""Supply SSL options for the tornado HTTPServer. + See the tornado docs for details.""") + jinja_environment_options = Dict(config=True, help="Supply extra arguments that will be passed to Jinja environment.") @@ -826,11 +830,13 @@ class NotebookApp(BaseIPythonApplication): self.log, self.base_url, self.default_url, self.tornado_settings, self.jinja_environment_options ) + ssl_options = self.ssl_options if self.certfile: - ssl_options = dict(certfile=self.certfile) - if self.keyfile: - ssl_options['keyfile'] = self.keyfile - else: + ssl_options['certfile'] = self.certfile + if self.keyfile: + ssl_options['keyfile'] = self.keyfile + if not ssl_options: + # None indicates no SSL config ssl_options = None self.login_handler_class.validate_security(self, ssl_options=ssl_options) self.http_server = httpserver.HTTPServer(self.web_app, ssl_options=ssl_options,