File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -531,6 +531,29 @@ def test_slapadd(self):
531
531
("myAttribute" , b'foobar' ),
532
532
])
533
533
534
+ @requires_tls ()
535
+ @requires_ldapi ()
536
+ def test_ldapi_tls_opt_host_name (self ):
537
+ l = self .ldap_object_class (self .server .ldapi_uri )
538
+ self .assertEqual (l .whoami_s (), '' )
539
+ l .unbind_s ()
540
+
541
+ l = self .ldap_object_class (self .server .ldapi_uri )
542
+ l .set_option (ldap .OPT_X_TLS_CACERTFILE , self .server .cafile )
543
+ l .set_option (ldap .OPT_HOST_NAME , self .server .hostname )
544
+ l .set_option (ldap .OPT_X_TLS_NEWCTX , 0 )
545
+ l .start_tls_s ()
546
+ self .assertEqual (l .whoami_s (), '' )
547
+
548
+ @requires_tls ()
549
+ @requires_ldapi ()
550
+ def test_ldapi_tls (self ):
551
+ l = self .ldap_object_class (self .server .ldapi_uri )
552
+ l .set_option (ldap .OPT_X_TLS_CACERTFILE , self .server .cafile )
553
+ l .set_option (ldap .OPT_X_TLS_NEWCTX , 0 )
554
+ l .start_tls_s ()
555
+ self .assertEqual (l .whoami_s (), '' )
556
+
534
557
535
558
class Test01_ReconnectLDAPObject (Test00_SimpleLDAPObject ):
536
559
"""
You can’t perform that action at this time.
0 commit comments