Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

Change the URL to include the port used for SSL, for example ldaps://localhost:636 (assuming 636 is the port upon which the LDAP server listens for secure client connections).

share|improve this answer
    
We receive the same result using ldaps://locahost:636. 636 is definitely the port that is open on our ldap server. –  Sean Nov 5 '12 at 16:24
    
Hi Terry, do you by any chance know what else I can possibly do to resolve the issue? –  Sean Nov 7 '12 at 12:58
add comment
up vote 0 down vote accepted

Followed: http://greg.cathell.net/php_ldap_ssl.html

Looks like steps #3, #5-7 needed be complete in Windows.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.