Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74055 - Secure LDAP (ldaps://) doesn't work with PHP 5.x
Summary: Secure LDAP (ldaps://) doesn't work with PHP 5.x
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 18:26 UTC by Gregory Szorc
Modified: 2004-12-29 21:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Szorc 2004-12-10 18:26:36 UTC
After upgrading to PHP 5.0.2, I am unable to do a secure connect to an LDAP server.  The same code works fine in PHP 4.3.x.  The function call ldap_connect("ldaps://foo.bar") returns the error code 81 "Can't contact LDAP server."  ldap_connect("ldap://foo.bar") works fine.  Attempting to use TLS results in error number 91 "Connect error" after a call to ldap_start_tls($conn).

The same code works fine in PHP 4.3.x.  I recompiled openldap, apache, openssl, and php to no avail.  I have reproduced this problem on two P4 systems running ~x86.

Can anybody else reproduce this problem?

Reproducible: Always
Steps to Reproduce:
1.Use mod_php-5.*
2.Try using encryption when talking to an LDAP server
3.

Actual Results:  
Connection failed

Expected Results:  
Connection successful

Full ~x86 system (except using gcc 3.3.x).  Apache 2.0.52 w/ mod_php-5.0.2
Comment 1 Gregory Szorc 2004-12-29 19:47:14 UTC
The problem still persists with PHP 5.0.3.  However, I have no problem when using PHP 5.0.3 with Apache 2.0.52 running on my iBook.  I will try compiling from source without the ebuild on my Gentoo machines and see if I can pinpoint the cause of this bug.
Comment 2 Gregory Szorc 2004-12-29 21:56:14 UTC
Solution:

Edit /etc/openldap/ldap.conf
Add the following line:

TLS_REQCERT     never


Recompile mod_php

It appears that PHP5 has the values in ldap.conf compiled-in, so simply changing the value won't affect the current build.  I haven't run a stack trace, so I don't know if PHP is looking for a hard-coded path to ldap.conf or similar file at run time.