the data i need to connect to the ldaps server is correct and here is the code i am using
- Code: Select all
<?php
$config = array(
'host' => 'ldaps://***.com',
'port' => some int,
'bind' => 'uid=***,dc=***,dc=***,dc=***',
'pass' => '***',
'dbase' => 'dc=***,dc=***,dc=***'
);
$c = ldap_connect($config['host'],$config['port']);
if ($c==FALSE) {
echo 'Error ldap_connect';
}
else {
$action = ldap_bind($c,$config['bind'],$config['pass']);
if ($action==FALSE) {
echo 'LDAP bind fail <br/> ';
echo 'ldap_error : <b>'.ldap_error($c).'</b> <br/>';
}
else {
echo 'LDAP bind true';
}
}
?>
the error i am getting is this one : Can't contact LDAP server
with the data for the ldaps server i get 2 certificates ... a SSL CA certificate and a ROOT CA certificate
the problem could be becose i am not using those certificates and if so how can i use them? i search on google but no results...please help
thanks