Skip to content

Commit 7b01ba9

Browse files
authored
Merge pull request #174 from wp-cli/fix/adapt-to-requests-v2
2 parents a1345d2 + ab2d33f commit 7b01ba9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"require": {
1515
"ext-json": "*",
1616
"composer/composer": "^1.10.23 || ~2.2.17",
17-
"wp-cli/wp-cli": "^2.5"
17+
"wp-cli/wp-cli": "dev-main as 2.8.x-dev"
1818
},
1919
"require-dev": {
2020
"wp-cli/scaffold-command": "^1 || ^2",

src/Package_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use WP_CLI\Utils;
2727
use WP_CLI\JsonManipulator;
2828
use WP_CLI\PackageManagerEventSubscriber;
29+
use WP_CLI\RequestsLibrary;
2930

3031
/**
3132
* Lists, installs, and removes WP-CLI packages.
@@ -78,7 +79,6 @@
7879
class Package_Command extends WP_CLI_Command {
7980

8081
const PACKAGE_INDEX_URL = 'https://wp-cli.org/package-index/';
81-
const SSL_CERTIFICATE = '/rmccue/requests/library/Requests/Transport/cacert.pem';
8282

8383
const DEFAULT_DEV_BRANCH_CONSTRAINTS = 'dev-main || dev-master || dev-trunk';
8484

@@ -1316,8 +1316,8 @@ private function set_composer_auth_env_var() {
13161316
*/
13171317
private function avoid_composer_ca_bundle() {
13181318
if ( Utils\inside_phar() && ! getenv( 'SSL_CERT_FILE' ) && ! getenv( 'SSL_CERT_DIR' ) && ! ini_get( 'openssl.cafile' ) && ! ini_get( 'openssl.capath' ) ) {
1319-
$certificate = Utils\extract_from_phar( WP_CLI_VENDOR_DIR . self::SSL_CERTIFICATE );
1320-
putenv( "SSL_CERT_FILE={$certificate}" );
1319+
$certificate_path = Utils\extract_from_phar( RequestsLibrary::get_bundled_certificate_path() );
1320+
putenv( "SSL_CERT_FILE={$certificate_path}" );
13211321
}
13221322
}
13231323

0 commit comments

Comments
 (0)