Allow verify_peer/verify_peer_name http options to be handled by curl downloader
parent
c3d40ae79a
commit
8cec8bd546
|
@ -56,6 +56,8 @@ class CurlDownloader
|
|||
'ssl' => array(
|
||||
'cafile' => CURLOPT_CAINFO,
|
||||
'capath' => CURLOPT_CAPATH,
|
||||
'verify_peer' => CURLOPT_SSL_VERIFYPEER,
|
||||
'verify_peer_name' => CURLOPT_SSL_VERIFYHOST,
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -178,10 +180,14 @@ class CurlDownloader
|
|||
foreach (self::$options as $type => $curlOptions) {
|
||||
foreach ($curlOptions as $name => $curlOption) {
|
||||
if (isset($options[$type][$name])) {
|
||||
if ($type === 'ssl' && $name === 'verify_peer_name') {
|
||||
curl_setopt($curlHandle, $curlOption, $options[$type][$name] === true ? 2 : $options[$type][$name]);
|
||||
} else {
|
||||
curl_setopt($curlHandle, $curlOption, $options[$type][$name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$progress = array_diff_key(curl_getinfo($curlHandle), self::$timeInfo);
|
||||
|
||||
|
|
Loading…
Reference in New Issue