Skip to content

Commit 1a6fc8e

Browse files
authored
Merge pull request #4531 from Quansight/change-default-ssl
Changed the default protocol
2 parents f21650e + 5517780 commit 1a6fc8e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

notebook/notebookapp.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,13 @@ def init_webapp(self):
14201420
else:
14211421
# SSL may be missing, so only import it if it's to be used
14221422
import ssl
1423-
# Disable SSLv3 by default, since its use is discouraged.
1424-
ssl_options.setdefault('ssl_version', ssl.PROTOCOL_TLSv1)
1423+
# PROTOCOL_TLS selects the highest ssl/tls protocol version that both the client and
1424+
# server support. When PROTOCOL_TLS is not available use PROTOCOL_SSLv23.
1425+
# PROTOCOL_TLS is new in version 2.7.13, 3.5.3 and 3.6
1426+
ssl_options.setdefault(
1427+
'ssl_version',
1428+
getattr(ssl, 'PROTOCOL_TLS', ssl.PROTOCOL_SSLv23)
1429+
)
14251430
if ssl_options.get('ca_certs', False):
14261431
ssl_options.setdefault('cert_reqs', ssl.CERT_REQUIRED)
14271432

0 commit comments

Comments
 (0)