diff --git a/src/globals/ext-tests/curl.php b/src/globals/ext-tests/curl.php index 7c3eecf7..16b31e6e 100644 --- a/src/globals/ext-tests/curl.php +++ b/src/globals/ext-tests/curl.php @@ -6,13 +6,27 @@ assert(function_exists('curl_init')); assert(function_exists('curl_setopt')); assert(function_exists('curl_exec')); assert(function_exists('curl_close')); +assert(function_exists('curl_version')); $curl_version = curl_version(); if (stripos($curl_version['ssl_version'], 'schannel') !== false) { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://captive.apple.com/'); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_HEADER, 0); - $data = curl_exec($curl); - curl_close($curl); - assert($data !== false); + $domain_list = [ + 'https://captive.apple.com/', + 'https://detectportal.firefox.com/', + 'https://static-php.dev/', + 'https://www.example.com/', + ]; + $valid = false; + foreach ($domain_list as $domain) { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $domain); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_HEADER, 0); + $data = curl_exec($curl); + curl_close($curl); + if ($data !== false) { + $valid = true; + break; + } + } + assert($valid); } diff --git a/src/globals/ext-tests/openssl.php b/src/globals/ext-tests/openssl.php index 79c86323..189c222e 100644 --- a/src/globals/ext-tests/openssl.php +++ b/src/globals/ext-tests/openssl.php @@ -5,7 +5,20 @@ declare(strict_types=1); assert(function_exists('openssl_digest')); assert(openssl_digest('123456', 'md5') === 'e10adc3949ba59abbe56e057f20f883e'); if (file_exists('/etc/ssl/openssl.cnf')) { - assert(file_get_contents('https://captive.apple.com/') !== false); + $domain_list = [ + 'https://captive.apple.com/', + 'https://detectportal.firefox.com/', + 'https://static-php.dev/', + 'https://www.example.com/', + ]; + $valid = false; + foreach ($domain_list as $domain) { + if (file_get_contents($domain) !== false) { + $valid = true; + break; + } + } + assert($valid); } if (PHP_VERSION_ID >= 80500 && defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER >= 0x30200000) { assert(function_exists('openssl_password_hash'));