When using following connection string
mongodb://127.0.0.1/database?ssl_cert_reqs=2
an exception is raised
File "/opt/ampli/apps/marvintaskmgr/venv/lib/python2.7/site-packages/pymongo/uri_parser.py", line 308, in parse_uri options = split_options(opts) File "/opt/ampli/apps/marvintaskmgr/venv/lib/python2.7/site-packages/pymongo/uri_parser.py", line 211, in split_options return validate_options(options) File "/opt/ampli/apps/marvintaskmgr/venv/lib/python2.7/site-packages/pymongo/uri_parser.py", line 153, in validate_options option, value = validate(option, value) File "/opt/ampli/apps/marvintaskmgr/venv/lib/python2.7/site-packages/pymongo/common.py", line 351, in validate value = validator(option, value) File "/opt/ampli/apps/marvintaskmgr/venv/lib/python2.7/site-packages/pymongo/common.py", line 133, in validate_cert_reqs "`ssl.CERT_REQUIRED" % (option,)) ConfigurationError: The value of ssl_cert_reqs must be one of: `ssl.CERT_NONE`, `ssl.CERT_OPTIONAL` or `ssl.CERT_REQUIRED
ssl_cert_reqs validator only allows (ssl.CERT_NONE, ssl.CERT_OPTIONAL, ssl.CERT_REQUIRED) or (0, 1, 2) while the value is a string.
Suggest to allow 'CERT_NONE', 'CERT_OPTIONAL' and 'CERT_REQUIRED' as options for ssl_cert_reqs
https://github.com/mongodb/mongo-python-driver/blob/v2.8/pymongo/common.py#L126-L131