[Date Prev][Date Next] [Chronological] [Thread] [Top]

SSL connection using libLDAP



I am trying to connect to my LDAP directory using libLDAP. With SSL disable the following code works, but since I switched SSL on it breaks.

	ldap = ldap_init([hostname cString], [port intValue]);
	ldap_perror(ldap, "LDAP INITIALISED");
	const int version = 3;
	int e = ldap_set_option(ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
	ldap_perror(ldap, "LDAP VERSION 3 SET");

	e = ldap_simple_bind_s(ldap, [username cString], [password cString]);
	
	char * errorMessage = ldap_err2string(e);
	ldap_perror(ldap, "LDAP BOUND");

The error reported is :

LDAP BOUND: Can't contact LDAP server (-1)

I figure this is a problem with ldap_simpel_bind_s, but i can't find what I need to modify for SSL to work.

Thanks

Alexander Hartner
alex@j2anywhere.com

Does a good farmer neglect a crop he has planted?
Does a good teacher overlook even the most humble student?
Does a good father allow a single child to starve?
Does a good programmer refuse to maintain his code?
  - The Tao of Programming