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.
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.