Navigation Menu

Skip to content

Commit

Permalink
PYTHON-934 - allow ssl_match_hostname option to be passed as string
Browse files Browse the repository at this point in the history
  • Loading branch information
Len Buckens authored and behackett committed Jun 15, 2015
1 parent 66dbe93 commit 6400922
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pymongo/common.py
Expand Up @@ -416,7 +416,7 @@ def validate_ok_for_update(update):
'ssl_certfile': validate_readable,
'ssl_cert_reqs': validate_cert_reqs,
'ssl_ca_certs': validate_readable,
'ssl_match_hostname': validate_boolean,
'ssl_match_hostname': validate_boolean_or_string,
'read_preference': validate_read_preference,
'readpreference': validate_read_preference_mode,
'readpreferencetags': validate_read_preference_tags,
Expand Down
4 changes: 4 additions & 0 deletions test/test_uri_parser.py
Expand Up @@ -102,6 +102,10 @@ def test_split_options(self):
self.assertRaises(ValueError, split_options, 'connectTimeoutMS=0.0')
self.assertRaises(ValueError, split_options, 'connectTimeoutMS=1e100000')
self.assertRaises(ValueError, split_options, 'connectTimeoutMS=-1e100000')
self.assertRaises(ValueError, split_options, 'ssl=foo')
self.assertTrue(split_options('ssl=true'))
self.assertRaises(ValueError, split_options, 'ssl_match_hostname=foo')
self.assertTrue(split_options('ssl_match_hostname=true'))

# On most platforms float('inf') and float('-inf') represent
# +/- infinity, although on Python 2.4 and 2.5 on Windows those
Expand Down

0 comments on commit 6400922

Please sign in to comment.