Skip to content

Commit 23ee34f

Browse files
committed
Add verify none test, differentiate
1 parent 7109463 commit 23ee34f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/integration/test_bind.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ def test_bind_fail
2020
refute @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "not my password"), @ldap.get_operation_result.inspect
2121
end
2222

23-
def test_bind_tls
23+
def test_bind_tls_with_cafile
2424
tls_options = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.merge(:ca_file => CA_FILE)
2525
@ldap.encryption(method: :start_tls, tls_options: tls_options)
2626
assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1"), @ldap.get_operation_result.inspect
2727
end
28+
29+
def test_bind_tls_with_verify_none
30+
tls_options = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.merge(:verify_mode => OpenSSL::SSL::VERIFY_NONE)
31+
@ldap.encryption(method: :start_tls, tls_options: tls_options)
32+
assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1"), @ldap.get_operation_result.inspect
33+
end
2834
end

0 commit comments

Comments
 (0)