[php-src] PR #25834: Fix GH-25727: CURLOPT_CAINFO and CURLOPT_CAPATH do not accept null
| From: | AyhamJo7 | Date: | Fri, 27 Nov 2026 12:55:21 +0000 |
| Subject: | [php-src] PR #25834: Fix GH-25727: CURLOPT_CAINFO and CURLOPT_CAPATH do not accept null | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41112@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25834
Author: AyhamJo7
The quoted paragraphs were written with an LLM (disclosed as "LLM usage in GitHub
comments" in CONTRIBUTING.md asks).
> Fixes GH-25727. does. It verifies the server certificate through
>
>
> Tested on this branch with
curl_setopt() converted
> null for CURLOPT_CAINFO and
> CURLOPT_CAPATH to an empty string. libcurl takes an empty string as
> a path, cannot load it and ends the transfer with
> CURLE_SSL_CACERT_BADFILE (77). So there was no way to turn off one
> source of CA certificates and keep verifying against the other. The two options move to the nullable
> string options, the same change as a8a3b99 (GH-11433) made for
> CURLOPT_ACCEPT_ENCODING. Values other than
> null are handled as before.
>
> The test starts openssl s_server the way �ӿ[�d
> ����CCURLOPT_CAPATH only and through
> CURLOPT_CAINFO only, then sets
> CURLOPT_CAINFO and resets both options to
> null, which has to make verification fail with error 60. Without the
> fix all three requests end with error 77. The third case is there because code that ignored �l�
> z�V`a^��,��null would pass the first two.--enable-debug --enable-zts against
> libcurl 8.5.0 (Ubuntu 24.04) and 7.88.1 (Debian 12, the version in the report):
> ext/curl has 151 passed, 18 skipped and 0 failed with both. The PR
> targets PHP-8.4 as the lowest supported branch; the lines are the same on master.
>
> CURLOPT_PROXY_CAINFO and
> CURLOPT_PROXY_CAPATH have the same limitation. They are not part of
> this PR because I have no HTTPS proxy test for them; I can add them if you prefer.