Commit 470861be authored by Franco Fichtner's avatar Franco Fichtner

inc: remove proxy usage from alias download function

parent 60b543e5
......@@ -402,21 +402,11 @@ function download_file($url, $destination, $verify_ssl = false, $connect_timeout
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/usr/local/opnsense/version/opnsense")));
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
if (!empty($config['system']['proxyport'])) {
curl_setopt($ch, CURLOPT_PROXYPORT, $config['system']['proxyport']);
}
if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
@curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}");
}
}
@curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
fclose($fp);
curl_close($ch);
return ($http_code == 200) ? true : $http_code;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment