Project

General

Profile

« Previous | Next » 

Revision 1fa63e8d

Added by Steve Beaver over 4 years ago

Fixed #11464 by adding proxy configuration to web service calls

(cherry picked from commit 2cb3c56db2366c9cadb04757bd3143ea0d7e7378)

View differences:

src/etc/inc/copyget.inc
36 36
// Poll the Netgate server to obtain the JSON/HTML formatted support information
37 37
// and write it to the JSON file
38 38
function updatecopyright() {
39
	global $g, $copyrightfile, $tmpfile, $idfile, $FQDN;
39
	global $g, $copyrightfile, $tmpfile, $idfile, $FQDN, $config;
40 40

  
41 41
	if (file_exists($idfile)) {
42 42
		if (function_exists('curl_version')) {
......
52 52
			curl_setopt($ch, CURLOPT_POST, true);
53 53
			curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
54 54
			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,4);
55

  
56
			if (!empty($config['system']['proxyurl'])) {
57
				curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
58
				if (!empty($config['system']['proxyport'])) {
59
					curl_setopt($ch, CURLOPT_PROXYPORT, $config['system']['proxyport']);
60
				}
61
				if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
62
					@curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE);
63
					curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}");
64
				}
65
			}
66

  
55 67
			$response = curl_exec($ch);
56 68
			$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
57 69
			curl_close($ch);

Also available in: Unified diff