From 88d51932934e77e12ab2c5d99dda06fbb87a9f51 Mon Sep 17 00:00:00 2001 From: restena-sw <stefan.winter@restena.lu> Date: Fri, 15 Jan 2016 15:13:05 +0100 Subject: [PATCH] Update HTTP.php --- lib/SimpleSAML/Utils/HTTP.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php index 7aaa19779..b73cf1302 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; } -- GitLab