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