ldap_bind issues



I have been attempting to do a bind to an LDAP server that requires
SSL. No matter what I do though, the bind fails. I have tried
everything I can think to try, but this is not working. The server
admins think the server is setup correctly, but I am beginning to
think differently. Here is the code I have:

<?php

$surname = "T";

//Connect
$connect = ldap_connect("ldaps://ldapserver.com", "636");

ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);

//Bind to the ldap directory
$bd = ldap_bind($connect,"cn=me,ou=People,o=work,c=US","password")
or die("Couldn't bind to LDAP server!");

$filter="(|(sn=$surname*))";

//Search the directory
$result = ldap_search($connect, "ou=People,o=work,c=US", $filter);

//Create result set
$entries = ldap_get_entries($connect, $result);

//Sort and print
echo "User count: " . $entries["count"] . "<br /><br /><b>Users:</
b><br />";

for ($i=0; $i < $entries["count"]; $i++)
{
echo $entries[$i]["displayname"][0]."<br />";
}

ldap_unbind($connect);
?>
.



Relevant Pages

  • Re: Query LDAP from Linux??
    ... the LDAP Java stuff was ... This means he will need a server name to bind too. ... He will need a port, if he wants to do a standard LDAP bind he will want 389. ...
    (microsoft.public.windows.server.active_directory)
  • Re: LDAP Lookup failure
    ... bind but LDP can, then that should clear ldap for you. ... ldap to bind to the server. ... When it fails can you also do a forward and reverse lookup of the host name ...
    (microsoft.public.windows.server.active_directory)
  • Re: How to prevent LDAP simple bind?
    ... While you are using a program that uses ADSI to communicate to any ... the program cannot bind to the LDAP ... server by using the ADS_USE_SSL/ADS_USE_ENCRYPTION options in the ... SSL port number 636 when it makes a bind call to the LDAP server. ...
    (microsoft.public.win2000.active_directory)
  • Re: How to prevent LDAP simple bind?
    ... While you are using a program that uses ADSI to communicate to any ... the program cannot bind to the LDAP ... server by using the ADS_USE_SSL/ADS_USE_ENCRYPTION options in the ... SSL port number 636 when it makes a bind call to the LDAP server. ...
    (microsoft.public.windows.server.active_directory)
  • Delegate access from Entourage problems
    ... When you try to configure delegate access to a Microsoft Exchange Server account in Microsoft Entourage 2004 for Mac, ... Specify the name of your LDAP server in Entourage, ... These setting works fine for making LDAP request in our LDAP server for making "check names" requests ... 130.226.200.39 LDAP MsgId=1 Bind Request. ...
    (microsoft.public.mac.office.entourage)