-
Notifications
You must be signed in to change notification settings - Fork 998
Description
Bug Report
Describe the current, buggy behavior
The current integration with the Requests library surfaces an issue when the default certificate location provided by the Requests library has not been overridden and the library is found within the WP-CLI Phar file.
In that scenario, the location to the certificate file still points into the Phar file, and cURL cannot properly handle that file location, as it is unable to read archived files within Phar archives.
Describe how other contributors can replicate this bug
The behavior can be replicated by building a Phar archive an running tests using that Phar archive via WP_CLI_BIN_DIR
:
- Clone the
wp-cli/wp-cli-bundle
repository andcd
into its folder. - Run
composer install
- Run
php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --version=custom
- Run
mv wp-cli.phar wp && chmod +x wp
- Run
WP_CLI_BIN_DIR=/home/alain/wp-cli-bundle composer behat
Describe what you expect as the correct outcome
The tests should succeed.
But instead, they produce an error:
PHP Fatal error: Uncaught WpOrg\Requests\Exception: cURL error 77: error setting certificate verify locations:
CAfile: phar://wp/vendor/rmccue/requests/src/../certificates/cacert.pem
CApath: /etc/ssl/certs in phar://wp/vendor/rmccue/requests/src/Transport/Curl.php:490
Provide additional context/screenshots