Hi Team,
We are working on migration of nsldap C sdk to OpenLDAP C sdk for our application client code.
We are using OpenLDAP 2.6.7.
As part of this migration activity, we are replacing one of the timeout values.
Without setting LDAP_OPT_NETWORK_TIMEOUT value, ldap bind is working fine and application functionality also working well with bind, search and other operations.
After setting LDAP_OPT_NETWORK_TIMEOUT value, ldap_simple_bind_s is failing with return code -1 (LDAP error -1-Unknown Error).
Here is the snippet.
struct timeval tv = { 20, 0 };
ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, (void *) &tv);
lderr = ldap_simple_bind_s( ld, (char *)AdminDN, (char *)AdminPW);
Here we are getting bind failure with return code as -1. But without setting LDAP_OPT_NETWORK_TIMEOUT, the bind function is working well.
Could you help us to fix this issue? or let me know if I am missing anything here?
--