#17738 [Com]: SSL support for LDAP
| From: | phpdeveloper at chinese dot university dot hk | Date: | Sat, 19 Jul 2003 05:18:05 +0000 |
| Subject: | #17738 [Com]: SSL support for LDAP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-44294@lists.php.net to get a copy of this message | ||
ID: 17738
Comment by: phpdeveloper at chinese dot university dot hk
Reported By: benoit at gide dot net
Status: No Feedback
Bug Type: LDAP related
Operating System: Redhat 6.2 7.1 7.2
PHP Version: 4.2.1
New Comment:
i am using IIS+windows xp+php4.3.2.2 facing the same problem and can
not connect to the ldap except using ldaps://host:636/ but success
using ldap://host/
Previous Comments:
------------------------------------------------------------------------
[2002-09-11 11:19:30] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2002-06-21 15:17:11] venaas@php.net
If you use the OpenLDAP 2.x.x lib, the script below
should work. At least I don't see anything wrong.
Only error I can think of is that the lib isn't
compiled with SSL, but if this was the lib used when building
ldapsearch, then this should be okay too.
PHP doesn't really do anything clever with LDAP and SSL
here, it only passes the URL to the lib in ldap_connect()
and the lib will/should use SSL since the URL starts with
ldaps. This is exactly what ldapsearch does too. So I
don't really see what's wrong here.
I would try to see what LDAP library is used and check
whether it's compiled with SSL. strace/tcpdump/gdb might
be of use to see what's going on.
------------------------------------------------------------------------
[2002-06-13 10:46:09] sniper@php.net
Let's keep this in the right category. Easier for the
extension maintainer(s) to find these then.
------------------------------------------------------------------------
[2002-06-13 10:28:14] sander@php.net
I don't think PHP supports LDAP over SSL. Making this a feature
request, and updating summary.
------------------------------------------------------------------------
[2002-06-13 06:01:35] benoit at gide dot net
Compiled modules:
./configure --with-apache=../apache_1.3.24 --with-openssl --with-ldap
I have a problem when i use php to bind my ldap directory over ssl
If i use on shell command
ldapsearch -x -H 'ldaps://localhost/' -b 'uid=100000, ou=company,
dc=domain, dc=com' -D 'uid=100000, ou=company, dc=mydomain, dc=com'
-W
I have good result
My script is like that :
$server = "ldap://localhost" ;
$ds=ldap_connect($server);
$dn = "uid=100000, ou=company, dc=domain, dc=com";
$value = "password";
$result=@ldap_bind($ds,$dn,$value);
$dn = "ou=company, dc=domain, dc=com";
$filtre = "(cn=*DUPONT*)";
$sr = ldap_search($ds, $dn, $filtre);
$info = ldap_get_entries($ds, $sr);
for ($i=0; $i < $info["count"]; $i++) {
print "UID: ".$info[$i]["urn"][0]."<br /><br />";
}
ldap_close($ds);
i have a result, but if i change $server = "ldap://localhost" by
"ldaps://localhost) i have a error message "Can't contact LDAP server"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17738&edit=1