-
Type: Bug
-
Resolution: Fixed
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: None
MongoClient(ssl=True, tls=False) fails with an AttributeError:
>>> MongoClient(ssl=True, tls=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", line 672, in __init__ opts = _handle_security_options(opts) File "/Users/shane/git/mongo-python-driver/pymongo/uri_parser.py", line 217, in _handle_security_options options.cased_key('ssl'), options.cased_key('tls'))) AttributeError: 'dict' object has no attribute 'cased_key'
The expected behavior should be the same as this:
>>> MongoClient('mongodb://localhost/?ssl=true&tls=false') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", line 639, in __init__ res = uri_parser.parse_uri( File "/Users/shane/git/mongo-python-driver/pymongo/uri_parser.py", line 466, in parse_uri options.update(split_options(opts, validate, warn, normalize)) File "/Users/shane/git/mongo-python-driver/pymongo/uri_parser.py", line 326, in split_options options = _handle_security_options(options) File "/Users/shane/git/mongo-python-driver/pymongo/uri_parser.py", line 216, in _handle_security_options raise InvalidURI(err_msg % ( pymongo.errors.InvalidURI: Can not specify conflicting values for URI options ssl and tls.