if ((ld = ldap_init(HOSTNAME, PORTNUMBER)) == NULL)
{
perror("ldap_init");
return (1);
}
version = LDAP_VERSION3;
if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_SUCCESS)
{
//rc = ldap_get_lderrno(ld, NULL, NULL);
fprintf(stderr, "ldap_set_option: %s\n", ldap_err2string(rc));
ldap_unbind(ld);
return (1);
}
ldap_start_tls_s(ld, NULL, NULL);
char **temp;
if (ldap_get_option(ld, LDAP_OPT_X_TLS_CACERTDIR, temp) != LDAP_SUCCESS)
{
ldap_perror(ld, "ldap_get_option");
return (1);
}
Everything works except I am having problems with the ldap_get_option.
thanks