Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot connect or bind to Active Directory using LDAP API

Status
Not open for further replies.

revlis

Programmer
May 13, 2003
1
AU
Hi, I am very new to ldap programming and I was hoping someone could help me. I want to bind to an Active Directory that has SSL-enabled using the LDAP API provided by Microsoft's SDK. Here is my sample code:

Sample 1:
======================
LDAP* ld = ldap_sslinit(m_sHostName, 636, 1);
if (ld != NULL)
{
ULONG ret = ldap_connect(ld, NULL);
}

Sample 2:
=====================
LDAP* ld = ldap_sslinit(m_sHostName, 636, 1);
if (ld != NULL)
{
ULONG ret = ldap_bind_s(ld, m_sUsername, m_sPassword, LDAP_AUTH_SIMPLE);
}

For both the 'ldap_connect' or 'ldap_bind_s' call, the return code is LDAP_SERVER_DOWN.

But if i call 'ldap_sslinit' with 0 as the 3rd parameter, I am able to connect to the directory.

Can someone tell me what am I doing wrong.
 
I'm having similar problem. For some reason the ldap_connect does not work. Did you add the CA that issued the AD cert to your certificate database?
 
guys where can i get the certificate databases from?? do i need to generate them or export them from the directory???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top