From 191b2352e5ed4949075d7db2f7ca938a79b8221e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 Nov 2017 13:52:57 +0100 Subject: Also look at https_proxy for https URLs We accidentally regressed here in 1.5 when replacing the https method. --- methods/http.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'methods') 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") -- cgit v1.2.3