cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting error 'Proxy CONNECT aborted' when using CURLAUTH_ANY

From: Sudha <kssudha_at_gmail.com>
Date: Thu, 9 Apr 2009 08:01:52 +0530

The proxy-authorization headers and the credentials used in both the runs
are the same. But there seems to be a different sequence of requests sent in
both runs.

While using Basic auth, it directly tries to authenticate to the proxy:

About to connect() to proxy 10.209.112.250 port 3128 (#0)
  Trying 10.209.112.250...
connected
Connected to 10.209.112.250 (10.209.112.250) port 3128 (#0)
Establish HTTP proxy tunnel to download.juniper.net:443
Proxy auth using Basic with user 'username'
CONNECT download.juniper.net:443 HTTP/1.1
Host: download.juniper.net:443
Proxy-Authorization: Basic <username:passwd>
Proxy-Connection: Keep-Alive
HTTP/1.0 200 Connection established

Whereas in case of ANY, there is one extra roundtrip happening, which I
believe is to determine the proxy auth type:

About to connect() to proxy 10.209.112.250 port 3128 (#0)
  Trying 10.209.112.250...
connected
Connected to 10.209.112.250 (10.209.112.250) port 3128 (#0)
Establish HTTP proxy tunnel to download.juniper.net:443
CONNECT download.juniper.net:443 HTTP/1.1
Host: download.juniper.net:443
Proxy-Connection: Keep-Alive

HTTP/1.0 407 Proxy Authentication Required
Server: Squid/2.4.STABLE6
Mime-Version: 1.0
Date: Thu, 09 Apr 2009 02:23:40 GMT
Content-Type: text/html
Content-Length: 951
Expires: Thu, 09 Apr 2009 02:23:40 GMT
X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
Proxy-Authenticate: Basic realm="Squid proxy-caching web server"
X-Cache: MISS from qasrvtest1
Proxy-Connection: keep-alive

Ignore 951 bytes of response-body
Establish HTTP proxy tunnel to download.juniper.net:443
Proxy auth using Basic with user 'qasrv1'
CONNECT download.juniper.net:443 HTTP/1.1
Host: download.juniper.net:443
Proxy-Authorization: Basic <username:passwd>
Proxy-Connection: Keep-Alive
Proxy CONNECT aborted
Closing connection #0download failed - rc=56 err='Proxy CONNECT aborted'
I'm using libcurl version 7.19.4, OS is RedHat Linux 2.6.11 kernel.

Thanks,
Sudha.

On Wed, Apr 8, 2009 at 11:51 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 8 Apr 2009, Sudha wrote:
>
> If I just use CURLAUTH_BASIC, it works perfectly.
>>
>
> Since the Proxy-Authorization: headers should be identical in both runs you
> can just check if they are. If they aren't, you can base64 decode the
> credentials to see what libcurl sends and then start figuring out why. If
> they are identical, it feels like squid would have to answer some questions!
> ;-)
>
> And do tell us what libcurl version on what OS you're running.
>
> Also note that you've now exposed your username and password so I trust
> they're not used for anything public (or sensitive).
>
> --
>
> / daniel.haxx.se
>
Received on 2009-04-09