summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Utils/HTTP.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SimpleSAML/Utils/HTTP.php')
-rw-r--r--lib/SimpleSAML/Utils/HTTP.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index 7aaa197..b73cf13 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;
}