Secure LDAP bind fails php

This is a discussion on Secure LDAP bind fails php within the PHP Language forums, part of the PHP Programming Forums category; Dear PHP Programmers, Here is what I have: PHP Version 4.3.8 LDAP Support enabled RCS Version $Id: ldap....


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-20-2005
ngiven@hotmail.com
 
Posts: n/a
Default Secure LDAP bind fails php

Dear PHP Programmers,

Here is what I have:

PHP Version 4.3.8
LDAP Support enabled
RCS Version $Id: ldap.c,v 1.130.2.10 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:

<?php

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

$reporting = error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_USER_ERROR );

$ds=ldap_connect("ldap.byu.edu","636"); // must be a valid LDAP
server!
if ($ds) {
echo "Binding ...";
$bind=ldap_bind($ds, "uid=" . $username . ",ou=People,o=usc.edu",
$password);
if ($bind == false) {
echo "BAD AUTH<br>";
}
else {
echo "bind=" . $bind . "<br>";
echo "userdn=" . $userdn . "<br>";
echo "AUTH OK<br>";
}
}
echo "Closing connection";
ldap_close($ds);
?>


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?

Thanks!
--
Nathan

Reply With Quote
  #2 (permalink)  
Old 01-24-2005
ngiven@hotmail.com
 
Posts: n/a
Default Re: Secure LDAP bind fails php

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


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

Thanks!
--
Nathan

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0