We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9a1bf1 commit 9a2e26eCopy full SHA for 9a2e26e
lib/net/ldap.rb
@@ -1237,12 +1237,16 @@ def use_connection(args)
1237
1238
# Establish a new connection to the LDAP server
1239
def new_connection
1240
- Net::LDAP::Connection.new \
+ connection = Net::LDAP::Connection.new \
1241
:host => @host,
1242
:port => @port,
1243
:hosts => @hosts,
1244
:encryption => @encryption,
1245
:instrumentation_service => @instrumentation_service
1246
+
1247
+ # Force connect to see if there's a connection error
1248
+ connection.socket
1249
+ connection
1250
rescue Errno::ECONNREFUSED, Net::LDAP::ConnectionRefusedError => e
1251
@result = {
1252
:resultCode => 52,
0 commit comments