Symfony version(s) affected: 5.3, 5.4
Description
Some CURL constants could be not defined depending on libcurl version.
Thus private CurlHttpClient::validateExtraCurlOptions throws Undefined constant "CURLOPT_PINNEDPUBLICKEY" even though user code doesn't use this constant.
|
\CURLOPT_PINNEDPUBLICKEY => 'peer_fingerprint', |
For example CURLOPT_PINNEDPUBLICKEY requires libcurl 7.39.0
How to reproduce
You could try Centos 7 with remi PHP.
PHP 8.0.8
cURL support => enabled
cURL Information => 7.29.0
$client = new CurlHttpClient();
$response = $client->request('GET', 'https://download.geonames.org/export/dump/alternatenames/RU.zip', [
'extra' => [
'curl' => [
CURLOPT_MAX_RECV_SPEED_LARGE => 1024
]
]
]);
var_dump(strlen($response->getContent()));
Possible Solution
Check that constant is defined(...) or add polyfill
Symfony version(s) affected: 5.3, 5.4
Description
Some CURL constants could be not defined depending on libcurl version.
Thus private
CurlHttpClient::validateExtraCurlOptionsthrowsUndefined constant "CURLOPT_PINNEDPUBLICKEY"even though user code doesn't use this constant.symfony/src/Symfony/Component/HttpClient/CurlHttpClient.php
Line 519 in 1fc489f
For example CURLOPT_PINNEDPUBLICKEY requires
libcurl 7.39.0How to reproduce
You could try
Centos 7withremi PHP.Possible Solution
Check that constant is
defined(...)or add polyfill