diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php index 7aaa1977987efa1fd10b67d636136af3f2195430..b73cf1302a5c3ca321fa67b0c959acda042f8a76 100644 --- a/lib/SimpleSAML/Utils/HTTP.php +++ b/lib/SimpleSAML/Utils/HTTP.php @@ -336,7 +336,8 @@ class HTTP /** - * Helper function to retrieve a file or URL with proxy support. + * Helper function to retrieve a file or URL with proxy support, also + * supporting proxy basic authorization.. * * An exception will be thrown if we are unable to retrieve the data. * @@ -361,10 +362,14 @@ class HTTP $config = \SimpleSAML_Configuration::getInstance(); $proxy = $config->getString('proxy', null); + $proxy_auth = $config->getString('proxy.auth', false); if ($proxy !== null) { if (!isset($context['http']['proxy'])) { $context['http']['proxy'] = $proxy; } + if ($proxy_auth !== false) ) { + $context['http']['header'] = "Proxy-Authorization: Basic".base64_encode($proxy_auth); + } if (!isset($context['http']['request_fulluri'])) { $context['http']['request_fulluri'] = true; }