Skip to content

Commit

Permalink
Fix rector warning: to
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaeIotu committed Nov 29, 2023
1 parent 0a32b24 commit 779d5c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,21 +548,21 @@ protected function setCURLOptions(array $curlOptions = [], array $config = [])

// SSL Verification
if (isset($config['verify'])) {
$config_verify = $config['verify'];
$configVerify = $config['verify'];

if (is_string($config_verify)) {
$file = realpath($config_verify) ?: $config_verify;
if (is_string($configVerify)) {
$file = realpath($configVerify) ?: $configVerify;

if (! is_file($file)) {
throw HTTPException::forInvalidSSLKey($config_verify);
throw HTTPException::forInvalidSSLKey($configVerify);
}

$curlOptions[CURLOPT_CAINFO] = $file;
$curlOptions[CURLOPT_SSL_VERIFYPEER] = true;
$curlOptions[CURLOPT_SSL_VERIFYHOST] = 2;
} elseif (is_bool($config_verify)) {
$curlOptions[CURLOPT_SSL_VERIFYPEER] = $config_verify;
$curlOptions[CURLOPT_SSL_VERIFYHOST] = $config_verify ? 2 : 0;
} elseif (is_bool($configVerify)) {
$curlOptions[CURLOPT_SSL_VERIFYPEER] = $configVerify;
$curlOptions[CURLOPT_SSL_VERIFYHOST] = $configVerify ? 2 : 0;
}
}

Expand Down

0 comments on commit 779d5c7

Please sign in to comment.