Page 1 of 1

Problem with LDAP via SSL

Posted: Thu May 07, 2009 6:48 pm
by AlexCh
I have a problem with LDAP over SSL.
I install Active Directory (ADAM) on Win XP and tuned up all necessary certificates for ADAM. So I can connect from ldp.exe to ADAM with SSL on port 636.
But I can't make it from PHP.

Code: Select all

if ($this->_use_ssl){
            $this->_conn = ldap_connect("ldaps://".$dc, 636);
        } else {
            $this->_conn = ldap_connect($dc, 389);
        }
        //set some ldap options for talking to AD
        ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
        ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0);
        $this->_bind = ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password);
If I try without SSL it works perfect. But with ssl it always give me a ERROR
FATAL: AD bind failed. Either the LDAPS connection failed or the login credentials are incorrect.PHP Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in C:\Inetpub\wwwroot\sugarcrm\include\ldap\adLDAP.php on line 118


Somebody can help me?

Re: Help!!! with LDAP SSL

Posted: Sun May 10, 2009 11:59 pm
by AlexCh
Please. Any ideas.

Re: Help!!! with LDAP SSL

Posted: Mon May 11, 2009 1:17 am
by Christopher
1) Don't use "Help!!!" in your title or posts.

2) Does the server you are connecting to support SSL?

3) Have you tried it without the 636? (see note in documentation for port parameter: http://us.php.net/ldap-connect)

Re: Help!!! with LDAP SSL

Posted: Mon May 11, 2009 6:11 pm
by AlexCh
arborint wrote:1) Don't use "Help!!!" in your title or posts.

2) Does the server you are connecting to support SSL?
Yes server support SSL and I can connect and make bind from ldp.exe(simple tools for Active Directory)
I use Microsoft Active Directory for application(ADAM) as a LDAP server.
arborint wrote:
3) Have you tried it without the 636? (see note in documentation for port parameter: http://us.php.net/ldap-connect)
It is working perfect without SSL. But does not work with SSL.
I configured php, openssl and ldap.conf as described in http://greg.cathell.net/php_ldap_ssl.html

But it is not working still