jeremycx / node-LDAP

LDAP binding for node.js
MIT License
221 stars 43 forks source link

TLS connection runs out of time #91

Open arvindsinghtomar opened 8 years ago

arvindsinghtomar commented 8 years ago

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?

calamarico commented 8 years ago

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 commented 8 years ago

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