node-LDAP
node-LDAP copied to clipboard
TLS connection runs out of time
I'm trying to connect LDAP server using this code
ldap = new LDAP({
uri: 'ldaps://host:port',
base: 'o=base',
attrs: '*',
validatecert: false,
version: 3,
reconnect: true,
connecttimeout: -1, // seconds, default is -1 (infinite timeout), connect timeout
filter: '*', // default filter for all future searches
scope: LDAP.SUBTREE
}, function(err) {
if (err) console.log("Conn err: ", err);
});
and this gives me error :
{ [LDAPError: Timeout] name: 'LDAPError', message: 'Timeout' }
can you help?
Hi arvin, i have the same tiemout error but not in connection, i have this timeout error in the search method. My connection object is this and i don't have any problem:
ldap = new LDAP({ uri: config.ldap.server, validatecert: false, connecttimeout: -1, });
FYI: You can override timeout and ntimeout properties (you can see this properties in index.js) try to override in your object:
ldap = new LDAP({ .... timeout: 5000, ntimeout: 5000 });