Binding to LDAPS using PHP failing
- by Sean
We've finally set-up our server to accept ldap SSL connections thanks to another question answered by a helpful member.
Our problem now is that when attempting to bind to ldap using the below simple PHP script, we constantly fail. Binding using ldap instead of ldaps works just fine using the script so I know the ldap is enabled. The catcher is that while using LDP.exe, we can successfully connect and bind to ldap on port 636 using a secure connection.
The script we are failing with is below:
<?php
$ldap = ldap_connect("ldaps://localhost");
$username="user";
$password="pass";
if($bind = ldap_bind($ldap, $username,$password ))
echo "logged in";
else
echo "fail";
echo "<br/>done";
?>
We've also attempted inputting the username as "user@domain" or "domain/user" with no success. It seems I'm forever having LDAP/Cert questions. Our environment is Server 2008.