cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems related to probing for proxy authentication methods

From: Joshua Kwan <jkwan_at_vmware.com>
Date: Wed, 30 Sep 2009 16:39:41 -0700

On 9/29/09 14:54, "Daniel Stenberg" <daniel_at_haxx.se> wrote:
> libcurl shouldn't require that the connection is persistant, and yes it should
> react on the 407 and do a new connection for the subsequent request. I thought
> that already worked... any chance you can write up a test case for the curl
> test suite that repeats this?

Yup. It's attached. (Took me quite a while to figure out how to work the
system.) It doesn't have a datacheck stage yet, I just wanted to pass along
the problem case to you -- when we do engineer a fix I'd be happy to improve
the test case.

BTW, here is a strace log of connecting to the actual CCProxy server.
My guess is that CCProxy is just broken by resetting the connection just
like that, but I'll leave it up to you whether we should support this kind
of situation or not.

I think the erroneous bit is that CCProxy doesn't reset the connection after
sending the 407, it only resets it after it gets more data. I am feeling
like that is very nonstandard behavior:

connect(3, {sa_family=AF_INET, sin_port=htons(8080),
sin_addr=inet_addr("10.114.25.113")}, 16) = -1 EINPROGRESS (Operation now in
progress)
poll([{fd=3, events=POLLOUT}], 1, 299995) = 1 ([{fd=3, revents=POLLOUT}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
sendto(3, "CONNECT foo.ourdomain.com:443 HTTP/1.1\r\nHost:
foo.ourdomain.com:443\r\nUser-Agent: curl/7.19.7-CVS
(x86_64-unknown-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8k zlib/1.2.3.3
libidn/1.15 libssh2/1.2\r\nProxy-Connection: Keep-Alive\r\n\r\n", 248,
MSG_NOSIGNAL, NULL, 0) = 248
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=3,
revents=POLLIN}])
recvfrom(3, "HTTP/1.0 407 Unauthorized\r\nServer:
CCProxy\r\nProxy-Authenticate: Basic realm=\"CCProxy
Authorization\"\r\nCache-control: no-cache\r\n\r\n<h1>Unauthorized
...</h1>\r\n<h2>IP Address: 10.114.25.112:42880<br>\r\nMAC Address:
<br>\r\nServer Time: 2009-09-30 16:28:07<br>\r\nAuth Result: </h2>", 16384,
0, NULL, NULL) = 271
sendto(3, "CONNECT foo.ourdomain.com:443 HTTP/1.1\r\nHost:
softwareupdate.eng.vmware.com:443\r\nProxy-Authorization: Basic
*********\r\nUser-Agent: curl/7.19.7-CVS (x86_64-unknown-linux-gnu)
libcurl/7.19.5 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
libssh2/1.2\r\nProxy-Connection: Keep-Alive\r\n\r\n", 289, MSG_NOSIGNAL,
NULL, 0) = 289 # We try to send the credentials along, but...
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=3,
revents=POLLIN}])
recvfrom(3, "", 16384, 0, NULL, NULL) = 0 # connection is RESET!
close(3) = 0

Let me know. I'd love to close the bug out on my end. :)

-Josh

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

  • application/octet-stream attachment: test2005
Received on 2009-10-01