Bug #73243 [NEW]: Unable to configure trusted CA
From: petr dot maly at remotehost dot cz
Operating system: Windows 10
PHP version: 7.0.11
Package: LDAP related
Bug Type: Bug
Bug description:Unable to configure trusted CA
Description:
------------
I have just migrated from PHP 5.6 to PHP 7 and I am unable to connect to
LDAP server using SSL. I am using openldap configuration, which was
placed at C:\openldap\sysconf\ldap.conf, to set trustworthy CA (PHP
5.6). This configuration file is ignored in PHP 7.
I have been inspecting php_ldap.dll binaries and I have discovered that,
in php 7 was the original hardcoded constant
'c:\openldap\sysconf\ldap.conf' replaced with '%SYSCONFDIR%\ldap.conf'.
I have tried to set SYSCONFDIR environment variable, but it is not
interpreted by the extension.
Could you fix the problem with loading of configuration file, please ?
Thanks,
Petr Maly
PS: Drew is facing the same problem:
http://stackoverflow.com/questions/35018674/php-ldap-connect-using-ldaps-to-connect-to-active-directory-getting-unknown-ca-e
Test script:
---------------
<?php
$a = ldap_connect("ldaps://adrien:636");
ldap_set_option($a, LDAP_OPT_NETWORK_TIMEOUT, 5);
ldap_set_option($a, LDAP_OPT_PROTOCOL_VERSION, 3); // v3 = UTF8
encoding
ldap_set_option($a, LDAP_OPT_REFERRALS, 0);
$r=ldap_bind($a);
echo "-$r-";
Expected result:
----------------
-1-
Actual result:
--------------
PHP Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP
server in C:\Temp\ldap\test.php on line 9
--
--
Edit bug report at https://bugs.php.net/bug.php?id=73243&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73243&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73243&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73243&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73243&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73243&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73243&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73243&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73243&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73243&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73243&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73243&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73243&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73243&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73243&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73243&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73243&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73243&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73243&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73243&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73243&r=mysqlcfg
Thread (18 messages)
- petr dot maly at remotehost dot cz
- ab@php.netBug #73243 [Opn->Fbk]: Unable to configure trusted CA
- cmb@php.netBug #73243 [Fbk]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Fbk->Opn]: Unable to configure trusted CA
- cmb@php.netBug #73243 [Opn->Ver]: Unable to configure trusted CA
- cmb@php.netBug #73243 [Ver]: Unable to configure trusted CA
- ab@php.netBug #73243 [Ver->Fbk]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Fbk->Asn]: Unable to configure trusted CA
- ab@php.netBug #73243 [Asn->Fbk]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Fbk->Asn]: Unable to configure trusted CA
- ab@php.netBug #73243 [Asn->Fbk]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Fbk->Asn]: Unable to configure trusted CA
- ab@php.netBug #73243 [Asn->Fbk]: Unable to configure trusted CA
- ab@php.netBug #73243 [Fbk->Csd]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Csd]: Unable to configure trusted CA
- cmb@php.netBug #73243 [Csd]: Unable to configure trusted CA
- petr dot maly at remotehost dot czBug #73243 [Csd]: Unable to configure trusted CA
- ab@php.netBug #73243 [Csd]: Unable to configure trusted CA