1
0
Fork 0

Allow running the config command to disable tls even if openssl is not present, fixes #9198

pull/9280/head
Jordi Boggiano 2020-10-12 08:16:31 +02:00
parent 28fe3baf9c
commit 159bb84fa6
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 1 deletions

View File

@ -586,7 +586,11 @@ class Factory
{ {
static $warned = false; static $warned = false;
$disableTls = false; $disableTls = false;
if ($config && $config->get('disable-tls') === true) { // allow running the config command if disable-tls is in the arg list, even if openssl is missing, to allow disabling it via the config command
if (isset($_SERVER['argv']) && in_array('disable-tls', $_SERVER['argv']) && (in_array('conf', $_SERVER['argv']) || in_array('config', $_SERVER['argv']))) {
$warned = true;
$disableTls = !extension_loaded('openssl');
} elseif ($config && $config->get('disable-tls') === true) {
if (!$warned) { if (!$warned) {
$io->writeError('<warning>You are running Composer with SSL/TLS protection disabled.</warning>'); $io->writeError('<warning>You are running Composer with SSL/TLS protection disabled.</warning>');
} }