|
|
|
|
@ -1420,8 +1420,13 @@ class NotebookApp(JupyterApp):
|
|
|
|
|
else:
|
|
|
|
|
# SSL may be missing, so only import it if it's to be used
|
|
|
|
|
import ssl
|
|
|
|
|
# Disable SSLv3 by default, since its use is discouraged.
|
|
|
|
|
ssl_options.setdefault('ssl_version', ssl.PROTOCOL_TLSv1)
|
|
|
|
|
# PROTOCOL_TLS selects the highest ssl/tls protocol version that both the client and
|
|
|
|
|
# server support. When PROTOCOL_TLS is not available use PROTOCOL_SSLv23.
|
|
|
|
|
# PROTOCOL_TLS is new in version 2.7.13, 3.5.3 and 3.6
|
|
|
|
|
ssl_options.setdefault(
|
|
|
|
|
'ssl_version',
|
|
|
|
|
getattr(ssl, 'PROTOCOL_TLS', ssl.PROTOCOL_SSLv23)
|
|
|
|
|
)
|
|
|
|
|
if ssl_options.get('ca_certs', False):
|
|
|
|
|
ssl_options.setdefault('cert_reqs', ssl.CERT_REQUIRED)
|
|
|
|
|
|
|
|
|
|
|