We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d65c597 commit 11ad905Copy full SHA for 11ad905
2 files changed
lib/net/ldap.rb
@@ -589,9 +589,11 @@ def authenticate(username, password)
589
# :tls_options => { :ca_file => "/etc/cafile.pem", :ssl_version => "TLSv1_1" }
590
# }
591
def encryption(args)
592
- case args
+ return if args.nil?
593
+
594
+ case method = args.to_sym
595
when :simple_tls, :start_tls
- args = { :method => args, :tls_options => {} }
596
+ args = { :method => method, :tls_options => {} }
597
end
598
@encryption = args
599
test/test_ldap.rb
@@ -64,4 +64,10 @@ def test_obscure_auth
64
@subject.auth "joe_user", password
65
assert_not_include(@subject.inspect, password)
66
67
68
+ def test_encryption
69
+ enc = @subject.encryption('start_tls')
70
71
+ assert_equal enc[:method], :start_tls
72
+ end
73
0 commit comments