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

2014-09-10 Thread Raoul Bhatia

On 2014-09-09 17:46, Michael Vogt wrote:

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.



Not sure if i am testing it right.

I tried to re-build apt-transport-https on my Ubuntu (!) workstation
and applied the patch before dpkg-buildpackage -uc -us.

I then installed the package,
but the behavior did not change.

Is there any easy possibility to debug this,
e.g. via adding some debug output or using strace/ltrace?

Moreover, upon checking curl.h from libcurl4-gnutls-dev:amd64 
7.35.0-1ubuntu2

i see:

  /* Comma separated list of hostnames defining no-proxy zones. These 
should

 match both hostnames directly, and hostnames within a domain. For
 example, local.com will match local.com and www.local.com, but NOT
 notlocal.com or www.notlocal.com. For compatibility with other
 implementations of this, .local.com will be considered to be the 
same as

 local.com. A single * is the only valid wildcard, and effectively
 disables the use of proxy. */
  CINIT(NOPROXY, OBJECTPOINT, 177),


Wouldn't this be easier to simply handover no_proxy to curl this way?

Cheers,
Raoul
--
DI (FH) Raoul Bhatia M.Sc. |   E-Mail.  ra...@bhatia.at
Software Development and   |   Web. http://raoul.bhatia.at/
System Administration  |   Tel. +43 699 10132530


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2014-09-09 Thread Raoul Bhatia
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.


Running Debian Wheezy,
apt 0.9.7.9+deb7u2
apt-transport-https 0.9.7.9+deb7u2
apt-utils 0.9.7.9+deb7u2

I'm using:

# env | grep proxy
http_proxy=http://proxy:8080
ftp_proxy=http://proxy:8181
https_proxy=http://proxy:8080
no_proxy=myserver.domain.tld,


relevant sources.list:

deb https://myserver.domain.tld/debian/ /


apt-get update -o Debug::Acquire::Https=true
still shows that APT is trying to use the proxy.



The following configuration via /etc/apt/apt.conf.d/proxy.conf does the 
trick:



# Platform Specific Proxy Configuration
Acquire::Http::Proxy http://proxy:8080;;
Acquire::Https::Proxy http://proxy:8080;;
Acquire::Ftp::Proxy http://proxy:8181;;

# DIRECT Access for myserver.domain.tld
Acquire::Https::Proxy::myserver.domain.tld DIRECT;


Cheers,
Raoul
PS. Please let me know in case I should file a new bug report.
--
DI (FH) Raoul Bhatia M.Sc. |   E-Mail.  ra...@bhatia.at
Software Development and   |   Web. http://raoul.bhatia.at/
System Administration  |   Tel. +43 699 10132530


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2014-09-09 Thread Michael Vogt
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