node-LDAP icon indicating copy to clipboard operation
node-LDAP copied to clipboard

TLS connection runs out of time

Open arvindsinghtomar opened this issue 8 years ago • 2 comments

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?

arvindsinghtomar avatar Sep 16 '16 13:09 arvindsinghtomar

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, });

calamarico avatar Sep 19 '16 08:09 calamarico

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 });

calamarico avatar Sep 19 '16 09:09 calamarico