[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#283718: no_proxy variable not honored by apt-transport-https



On Tue, Sep 09, 2014 at 04:27:32PM +0200, Raoul Bhatia wrote:
> I'm seeing this issue with correctly working no_proxy settings via
> /etc/environment and/or /root/.bashrc,
> which are correctly working for e.g. w3m but are not honored via
> apt-transport-https.

Thanks for your bugreport.
 
[..]
> "apt-get update -o Debug::Acquire::Https=true"
> still shows that APT is trying to use the proxy.

Could you please test the attached patch? It seems like the proxy
setting is not properly reset for libcurl.

Cheers,
 Michael
diff --git a/methods/https.cc b/methods/https.cc
index 0499af0..1b3d867 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -132,8 +132,14 @@ void HttpsMethod::SetupProxy()  					/*{{{*/
    {
       // Parse no_proxy, a comma (,) separated list of domains we don't want to use
       // a proxy for so we stop right here if it is in the list
-      if (getenv("no_proxy") != 0 && CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
+      if (getenv("no_proxy") != 0 &&
+          CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
+      {
+         Proxy = "";
+         curl_easy_setopt(curl, CURLOPT_PROXY, NULL);
+         curl_easy_setopt(curl, CURLOPT_PROXYPORT, 0);
 	 return;
+      }
    } else {
       const char* result = getenv("https_proxy");
       // FIXME: Fall back to http_proxy is to remain compatible with

Reply to: