Skip to content

Commit bb83a26

Browse files
committed
PYTHON-1726 Disable TLS renegotiation when possible
1 parent e01efc7 commit bb83a26

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ Changes in Version 3.8.0.dev0
6666
- :meth:`gridfs.grid_file.GridOut.read` now only checks for extra chunks after
6767
reading the entire file. Previously, this method would check for extra
6868
chunks on every call.
69-
7069
- :meth:`~pymongo.database.Database.current_op` now always uses the
7170
``Database``'s :attr:`~pymongo.database.Database.codec_options`
7271
when decoding the command response. Previously the codec_options
7372
was only used when the MongoDB server version was <= 3.0.
73+
- TLS Renegotiation is now disabled when possible.
7474

7575
Issues Resolved
7676
...............

pymongo/ssl_support.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def get_ssl_context(*args):
137137
ctx.options |= getattr(ssl, "OP_NO_SSLv3", 0)
138138
# OpenSSL >= 1.0.0
139139
ctx.options |= getattr(ssl, "OP_NO_COMPRESSION", 0)
140+
# Python 3.7+ with OpenSSL >= 1.1.0h
141+
ctx.options |= getattr(ssl, "OP_NO_RENEGOTIATION", 0)
140142
if certfile is not None:
141143
try:
142144
if passphrase is not None:

0 commit comments

Comments
 (0)