File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -634,12 +634,14 @@ def validate_tzinfo(dummy, value):
634
634
'tls' : validate_boolean_or_string ,
635
635
'tlsallowinvalidcertificates' : validate_allow_invalid_certs ,
636
636
'ssl_cert_reqs' : validate_cert_reqs ,
637
+ # Normalized to ssl_match_hostname which is the logical inverse of tlsallowinvalidhostnames
637
638
'tlsallowinvalidhostnames' : lambda * x : not validate_boolean_or_string (* x ),
638
639
'ssl_match_hostname' : validate_boolean_or_string ,
639
640
'tlscafile' : validate_readable ,
640
641
'tlscertificatekeyfile' : validate_readable ,
641
642
'tlscertificatekeyfilepassword' : validate_string_or_none ,
642
- 'tlsdisableocspendpointcheck' : validate_boolean_or_string ,
643
+ # Normalized to ssl_check_ocsp_endpoint which is the logical inverse of tlsdisableocspendpointcheck
644
+ 'tlsdisableocspendpointcheck' : lambda * x : not validate_boolean_or_string (* x ),
643
645
'tlsinsecure' : validate_boolean_or_string ,
644
646
'w' : validate_non_negative_int_or_basestring ,
645
647
'wtimeoutms' : validate_non_negative_integer ,
Original file line number Diff line number Diff line change @@ -480,6 +480,16 @@ def test_tlsinsecure_legacy_conflict(self):
480
480
with self .assertRaises (InvalidURI ):
481
481
parse_uri (uri , validate = False , warn = False , normalize = False )
482
482
483
+ def test_tlsDisableOCSPEndpointCheck (self ):
484
+ # check that tlsDisableOCSPEndpointCheck is handled correctly.
485
+ uri = "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true"
486
+ res = {'ssl_check_ocsp_endpoint' : False }
487
+ self .assertEqual (res , parse_uri (uri )["options" ])
488
+
489
+ uri = "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false"
490
+ res = {'ssl_check_ocsp_endpoint' : True }
491
+ self .assertEqual (res , parse_uri (uri )["options" ])
492
+
483
493
def test_normalize_options (self ):
484
494
# check that options are converted to their internal names correctly.
485
495
uri = ("mongodb://example.com/?tls=true&appname=myapp&maxPoolSize=10&"
You can’t perform that action at this time.
0 commit comments