cURL / Mailing Lists / curl-library / Single Mail

curl-library

Changes in proxy handling?

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 18 Feb 2005 05:02:44 -0600

Did something change in proxy handling between 7.12.0 and 7.12.2?? I
was just transferring some scripts from one machine to another, where
the old machine has a curl version prior to 7.12.0 and the new machine
has 7.12.3, and this happens:

   * About to connect() to proxy.domain.com port 80
   * Trying xxx.xxx.xxx.xxx... * connected
   * Connected to proxy.domain.com (xxx.xxx.xxx.xxx) port 80
   * Proxy auth using Basic with user 'MYUSERID'
> GET http://p16.company.com/ HTTP/1.1
   Proxy-Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx
   Host: p16.company.com
   Pragma: no-cache
   Accept: */*

   < HTTP/1.1 302 OK
   < Date: Fri, 18 Feb 2005 09:59:42 GMT
   < Content-Type: text/html
   < Connection: close
   < Location: http://xxxxx.company.com/something/
   < Via: 1.0 proxy003 (NetCache NetApp/5.5R5)
   * Closing connection #0
   * Issue another request to this URL: 'http://xxxxx.company.com/something/
   * About to connect() to proxy.domain.com port 80
   * Trying xxx.xxx.xxx.xxx... * connected
   * Connected to proxy.domain.com (xxx.xxx.xxx.xxx) port 80
> GET http://xxxxx.company.com/something/
   Host: xxxxx.company.com
   Pragma: no-cache
   Accept: */*

   < HTTP/1.1 407 Proxy Authentication Required
   < Date: Fri, 18 Feb 2005 09:59:42 GMT
   < Content-Length: 257
   < Content-Type: text/html
   < Server: NetCache appliance (NetApp/5.5R5)
   < Connection: close
   * Authentication problem. Ignoring this.
   < Proxy-Authenticate: Basic realm="proxy server proxy003.domain.com"
   * Closing connection #0

The important point is that, when following the Location header that
comes after the 302, curl-7.12.2 (and 7.12.3 & 7.13.0) sends the proxy
auth on the first connect, but doesn't re-send it when following the
Location:-redirect. Curl-7.12.1 did it like this:

   < HTTP/1.1 302 OK
   < Date: Fri, 18 Feb 2005 09:59:49 GMT
   < Content-Type: text/html
   < Connection: close
   < Location: http://xxxxx.company.com/something
   < Via: 1.0 proxy003 (NetCache NetApp/5.5R5)
   * Closing connection #0
   * Issue another request to this URL: 'http://xxxxx.company.com/something
   * About to connect() to proxy.domain.com port 80
   * Connected to proxy.domain.com (xxx.xxx.xxx.xxx) port 80
   * Proxy auth using Basic with user 'MYUSERID'
> GET http://xxxxx.company.com/something
   Proxy-Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx
   Host: xxxxx.company.com
   Pragma: no-cache
   Accept: */*

and it goes on to correctly fetch the page. Using the exact same
build script and command line in all cases.

Ralph Mitchell
Received on 2005-02-18