aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2013-07-16 20:09:59 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2013-09-25 22:35:56 -0400
commit35fbe24dedac8e5183e063d0eb24f15165b42960 (patch)
tree8927e628decaa6585d9b81cc13832d1233d35c79 /config
parent0972be75d0fb1e840e46ad12f86df95622eeeaf2 (diff)
downloadpfsense-packages-35fbe24dedac8e5183e063d0eb24f15165b42960.tar.gz
pfsense-packages-35fbe24dedac8e5183e063d0eb24f15165b42960.tar.bz2
pfsense-packages-35fbe24dedac8e5183e063d0eb24f15165b42960.zip
Allow use of system-specified proxy server for rule updates.
Diffstat (limited to 'config')
-rwxr-xr-xconfig/snort/snort_check_for_rule_updates.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php
index c40d6ff4..60747ea6 100755
--- a/config/snort/snort_check_for_rule_updates.php
+++ b/config/snort/snort_check_for_rule_updates.php
@@ -141,6 +141,18 @@ function snort_download_file_url($url, $file_out) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
+
+ // Use the system proxy server setttings if configured
+ 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']}");
+ }
+ }
+
$counter = 0;
$rc = true;
/* Try up to 4 times to download the file before giving up */