|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-11-18 10:42 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2016-11-18 10:42 UTC] cmb@php.net
[2016-11-18 14:51 UTC] jmaguire at duo dot com
-Status: Feedback
+Status: Assigned
[2016-11-18 14:51 UTC] jmaguire at duo dot com
[2016-11-18 15:19 UTC] cmb@php.net
-Status: Assigned
+Status: Open
[2016-11-18 15:19 UTC] cmb@php.net
[2016-11-18 15:19 UTC] cmb@php.net
-Assigned To: cmb
+Assigned To:
[2017-01-10 07:48 UTC] heiglandreas@php.net
-Status: Open
+Status: Feedback
[2017-01-10 07:48 UTC] heiglandreas@php.net
[2017-01-10 07:48 UTC] heiglandreas@php.net
-Assigned To:
+Assigned To: heiglandreas
[2017-01-22 04:22 UTC] php-bugs at lists dot php dot net
[2018-12-03 10:54 UTC] mail at ckristo dot net
[2019-01-15 21:20 UTC] theodorejb at outlook dot com
[2019-08-27 19:05 UTC] jimp at netgate dot com
[2021-07-26 13:26 UTC] cmb@php.net
-Status: No Feedback
+Status: Re-Opened
[2021-07-26 13:26 UTC] cmb@php.net
[2021-07-27 06:54 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 02:00:01 2025 UTC |
Description: ------------ New in PHP 7.1, LDAP_OPT_X_TLS_CACERTFILE should allow you to specify a CA certificate for an LDAP connection. However, this setting is silently ignored in lieu of the global system LDAP settings. Test script: --------------- <?php $conn = ldap_connect("ldaps://svr-dc01.acme.local", 389); var_dump($conn); ldap_set_option(LDAP_OPT_X_TLS_CACERTFILE, '/var/www/html/cert/ldap/acme_ad.crt'); ldap_start_tls($conn); $ldap_bind = ldap_bind($conn, 'acme\\administrator', 'password'); var_dump($ldap_bind); // root@7a4887b9f003:~# php ldap.php // resource(4) of type (ldap link) // bool(false) // root@7a4887b9f003:~# cp /var/www/html/cert/ldap/acme_ad.crt /var/www/html/cert/ldap/active.crt // root@7a4887b9f003:~# php ldap.php // resource(4) of type (ldap link) // bool(true) // // root@7a4887b9f003:~# cat /etc/ldap/ldap.conf // TLS_CACERT /var/www/html/cert/ldap/active.crt Expected result: ---------------- I expect to receive "bool(true)" in both results, as the LDAP certificate used should be /var/www/html/cert/ldap/acme_ad.crt. Actual result: -------------- I receive "bool(false)" in the first result because the LDAP certificate "/var/www/html/cert/ldap/active.crt" (set in /etc/ldap/ldap.conf) is being used instead -- as such, if the cert is copied to that path, I receive "bool(true)"