Secure LDAP bind fails php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Dear PHP Programmers,

Here is what I have:

PHP Version 4.3.8
LDAP Support     enabled
RCS Version     $Id: ldap.c,v 2004/06/01 21:05:33 iliaa Exp $
Total Links     0/unlimited
API Version     2004
Vendor Name     OpenLDAP
Vendor Version     20122

I am trying to use LDAP to authenticate my users via LDAP.  But I am
running into a problem...

When I try to use ldap_bind() with a secure connection (by specifiying
port 636), the page just hangs.

Here is my code:


$username = "fake";
$password = "fakepassword";

$reporting = error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR |

$ds=ldap_connect("","636");  // must be a valid LDAP
if ($ds) {
echo "Binding ...";
$bind=ldap_bind($ds, "uid=" . $username . ",ou=People,",
if ($bind == false) {
echo "BAD AUTH<br>";
else {
echo "bind=" . $bind . "<br>";
echo "userdn=" . $userdn . "<br>";
echo "AUTH OK<br>";
echo "Closing connection";

When I load it in a web browser, all I get is "Binding..." and it just
sits there.

If I change the port to 389, it works fine.
Any ideas?


Re: Secure LDAP bind fails php

Quoted text here. Click to load it

Am I the only person that has had this problem?  Maybe someone out
there knows a better list to post this question?


Site Timeline