connect ldap server using php anonymous is fine.
But , when I try to over ssl using the code below.
<?php
echo "<h3>LDAP query test</h3>";
define("LDAP_USERBASE","cn=1019157,ou=students,ou=users,ou=comp,ou=destech,o=rgu");
$username = "1019157";
$password = "XXXXXX";
$ldap = ldap_connect("10.52.1.246",636) or die("Can't connect to LDAP server");
$user = "uid=" . $username . "," . LDAP_USERBASE;
echo $user;
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3) ;
if (ldap_bind($ldap, $user, $password)) {
ldap_unbind($ldap);
echo 'OK - Login valid';
} else {
die(ldap_error($ldap) . ' (' . ldap_errno($ldap) . ')');
}
ldap_close($ldap);
?>
it gave the error
Can't contact LDAP server (-1)
someone said that php doesn't support over ssl. really?
No comments:
Post a Comment