Skip to content

Commit 199f429

Browse files
author
Tom Maher
committed
fix up to look like ruby-ldap#259 (diff)
1 parent 440ce7f commit 199f429

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/net/ldap/connection.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ 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 && encryption[:tls_options] &&
56-
encryption[:tls_options][:verify_mode] != OpenSSL::SSL::VERIFY_NONE
57-
@conn.post_connection_check(host)
55+
if encryption
56+
if encryption[:tls_options] &&
57+
encryption[:tls_options][:verify_mode] &&
58+
encryption[:tls_options][:verify_mode] == OpenSSL::SSL::VERIFY_NONE
59+
warn "not verifying SSL hostname of LDAPS server '#{host}:#{port}'"
60+
else
61+
@conn.post_connection_check(host)
62+
end
5863
end
5964
return
6065
rescue Net::LDAP::Error, SocketError, SystemCallError,

0 commit comments

Comments
 (0)