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

main
Jordi Boggiano 4 years ago
parent 28fe3baf9c
commit 159bb84fa6
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -586,7 +586,11 @@ class Factory
{
static $warned = 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) {
$io->writeError('<warning>You are running Composer with SSL/TLS protection disabled.</warning>');
}

Loading…
Cancel
Save