Skip to content

Commit 8b444a7

Browse files
guanlinzhouprashantmital
authored andcommitted
PYTHON-2397: MongoClient(ssl=True, tls=False) fails with an AttributeError (#592)
(cherry picked from commit 85f9f7a)
1 parent b082720 commit 8b444a7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pymongo/mongo_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def __init__(
655655
username = None
656656
password = None
657657
dbase = None
658-
opts = {}
658+
opts = common._CaseInsensitiveDictionary()
659659
fqdn = None
660660
for entity in host:
661661
if "://" in entity:

test/test_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ def test_uri_security_options(self):
452452
MongoClient('mongodb://localhost/?tlsInsecure=true',
453453
connect=False, ssl_cert_reqs=True)
454454

455+
# Conflicting kwargs should raise InvalidURI
456+
with self.assertRaises(InvalidURI):
457+
MongoClient(ssl=True, tls=False)
455458

456459
class TestClient(IntegrationTest):
457460

0 commit comments

Comments
 (0)