Jump to content

ldaps connection problem


Spleshmen

Recommended Posts

First i want to say hello all,second i need your help :)

i am trying to connect to a ldaps server from another server.

i got all the information i need to connect to the ldaps server (host,port,password,bind_rdn - second parameter from ldap_bind,base_dn - second parameter from ldap_search) and 2 certificates the SSL CA and Root CA generated from the ldaps server.

i never used the data from the certificates on the server i am trying to make the connection with the ldaps server.could that be the reason why i cant establish a connection?

here is my code :

$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 Can't contact LDAP server

thats about it ... thanks :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.