Bug #17738 Updated: SSL support for LDAP
| From: | sniper@php.net | Date: | Sat, 29 Jun 2002 14:46:06 +0000 |
| Subject: | Bug #17738 Updated: SSL support for LDAP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12520@lists.php.net to get a copy of this message | ||
ID: 17738
Updated by: sniper@php.net
Reported By: benoit@gide.net
-Status: Open
+Status: Feedback
Bug Type: LDAP related
Operating System: Redhat 6.2 7.1 7.2
PHP Version: 4.2.1
Previous Comments:
------------------------------------------------------------------------
[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@gide.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