Skip to content

Commit d7b36d1

Browse files
author
Tom Maher
committed
check that the encryption hash is defined before using it
1 parent 22eaf7c commit d7b36d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/net/ldap/connection.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def open_connection(server)
5252
hosts.each do |host, port|
5353
begin
5454
prepare_socket(server.merge(socket: @socket_class.new(host, port, socket_opts)), timeout)
55-
if encryption[:tls_options][:verify_mode] != OpenSSL::SSL::VERIFY_NONE
55+
if encryption && encryption[:tls_options] &&
56+
encryption[:tls_options][:verify_mode] != OpenSSL::SSL::VERIFY_NONE
5657
@conn.post_connection_check(host)
5758
end
5859
return

0 commit comments

Comments
 (0)