Fix windows ssl bug for curl (#674)

This commit is contained in:
Jerry Ma
2025-03-23 22:33:26 +08:00
committed by GitHub
parent d0a66ab16b
commit 7b6fae6d92
5 changed files with 23 additions and 9 deletions

View File

@@ -3,3 +3,16 @@
declare(strict_types=1);
assert(function_exists('curl_init'));
assert(function_exists('curl_setopt'));
assert(function_exists('curl_exec'));
assert(function_exists('curl_close'));
$curl_version = curl_version();
if (stripos($curl_version['ssl_version'], 'schannel') !== false) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://example.com/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
$data = curl_exec($curl);
curl_close($curl);
assert($data !== false);
}