|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-12 08:01 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2015-02-12 08:01 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ The Error occures if you create a PHAR with a .crt file in it. Setting the CURLOPT_CAINFO option and linking a .crt file within the phar leads to an error like this Curl failed to exec error setting certificate verify locations: CAfile: phar:///tmp/my.phar/demo/ca.crt CApath: /etc/ssl/certs ' in phar:///tmp/my.phar/demo/example.php:9 Setting CURLOPT_CAPATH to __DIR__ doesn't help either. Dumping the .crt file to stdOut works in phar mode so the file is there. Not compiled to phar the code works fine. Using: PHP 5.6.5 curl 7.26.0 (x86_64-pc-linux-gnu) libcurl/7.26.0 OpenSSL/1.0.1e zlib/1.2.7 libidn/1.25 libssh2/1.4.2 librtmp/2.3 Test script: --------------- <?php // curl setup $handle = curl_init(); $caFile = __DIR__ . '/ca.crt'; // check for crt file just to make sure its in the phar if (!is_file($caFile)) { throw new Exception("Failed to load ca certificate"); } curl_setopt($handle, CURLOPT_CAINFO, $caFile); // optionaly use this as well //curl_setopt($handle, CURLOPT_CAPATH, __DIR__); // make phar file containing this and a .crt file // contents of .crt doesn't matter for demonstration Expected result: ---------------- In a PHAR I want to link curl to .crt files i provide within the phar. Actual result: -------------- Curl can't access the .crt file within the phar Curl failed to exec error setting certificate verify locations: CAfile: phar:///tmp/my.phar/demo/ca.crt