You are here: Re: unable to start TLS in ldap queries « PHP Programming Language « IT news, forums, messages
Re: unable to start TLS in ldap queries

Posted by petersprc on 01/06/07 03:12

Hi,

You might want to make sure the hostname you're using in ldap_connect
matches the CN in the server's certificate exactly. You could try using
ldaps:// as the protocol. You might also need to set your certificate
dir or file in the client's ldap.conf file too.

For example, using the stock package from RHEL4:

/etc/openldap/ldap.conf:

TLS_CACERT /usr/share/ssl/certs/slapd.pem # self-signed cert

Client script:

<?

$ds = ldap_connect('ldaps://localhost.localdomain');
if ($ds === false) {
trigger_error('ldap_connect', E_USER_ERROR);
}

?>

yawnmoth wrote:
> When I try to use the ldap_search() function on an LDAP server and I've
> connected to, I get the following error message:
>
> Warning: ldap_search(): Search: Confidentiality required in
> C:\path\to\script.php on line xxx
>
> So I try to use ldap_start_tls() and get this error:
>
> Wwarning: ldap_start_tls(): Unable to start TLS: Connect error in
> C:\path\to\script.php on line xxx
>
> I try to set LDAP_OPT_PROTOCOL_VERSION to 3, with ldap_set_option,
> before doing ldap_start_tls, and get the same error.
>
> Anyway, I'm not really sure what the problem is. Any ideas?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация