summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-11-19 13:52:57 +0100
committerJulian Andres Klode <jak@debian.org>2017-11-19 13:59:30 +0100
commit191b2352e5ed4949075d7db2f7ca938a79b8221e (patch)
tree6e2b461b03a4775948184751266a9668337f63ab /methods
parente15d2e70447fc222cfde579e91903b22e2209ebf (diff)
Also look at https_proxy for https URLs
We accidentally regressed here in 1.5 when replacing the https method.
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/methods/http.cc b/methods/http.cc
index d939ba7b1..b7c9fe349 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -425,7 +425,9 @@ bool HttpServerState::Open()
In.Reset();
Out.Reset();
Persistent = true;
-
+
+ bool tls = (ServerName.Access == "https" || APT::String::Endswith(ServerName.Access, "+https"));
+
// Determine the proxy setting
// Used to run AutoDetectProxy(ServerName) here, but we now send a Proxy
// header in the URI Acquire request and set "Acquire::"+uri.Access+"::proxy::"+uri.Host
@@ -447,8 +449,16 @@ bool HttpServerState::Open()
}
else
{
- char* result = getenv("http_proxy");
- Proxy = result ? result : "";
+ char *result = getenv("http_proxy");
+ Proxy = result ? result : "";
+ if (tls == true)
+ {
+ char *result = getenv("https_proxy");
+ if (result != nullptr)
+ {
+ Proxy = result;
+ }
+ }
}
}
@@ -462,7 +472,6 @@ bool HttpServerState::Open()
if (Proxy.empty() == false)
Owner->AddProxyAuth(Proxy, ServerName);
- bool tls = (ServerName.Access == "https" || APT::String::Endswith(ServerName.Access, "+https"));
auto const DefaultService = tls ? "https" : "http";
auto const DefaultPort = tls ? 443 : 80;
if (Proxy.Access == "socks5h")