curl-and-python
Re: Proxy connect errors
Date: Thu, 30 Jun 2005 13:42:48 -0400
Daniel Stenberg wrote:
> On Tue, 28 Jun 2005, Andrew Bushnell wrote:
>
>> What I find is that seemingly randomly, the server fails to
>> authentiate and I get an error returned from pycurl. I am able to
>> replicate this on the command line using curl.exe from 7.14. What I
>> can do is run my particular command and if I rerun quick enough, the
>> failure occurs, here is the error code form curl:
>>
>> curl: (56) Received HTTP code 407 from proxy after CONNECT
>>
>> the command line that I am using looks as follows:
>>
>> curl --proxy [proxyserver:port] --proxytunnel --insecure --proxy-ntlm
>> --proxy-user [domain\username:password] https://mysecure url
>
>
> When you get this error code, did libcurl already authenticate? I mean,
> are you re-using an authenticated proxy-connection? Hm, when you rerun
> two curl command lines it of course can't re-use an existing one...
>
> No matter what, this smells like it can indeed be a libcurl bug lurking
> in there.
>
> Any chance you can get the request and response headers of the
> particular request that fails and show it to us? (Of course with
> sensitive data edited out first.)
OK, in pycurl I turned on verbose and here is what is printed out when
it fails:
* About to connect() to myproxy port 3128
* Trying myproxy...* connected
* Connected to myproxy port 3128
* Establish HTTP proxy tunnel to https_server:443
* Proxy auth using NTLM with user 'mydomain\myusername'
> CONNECT https_server:443 HTTP/1.0
Host: https_server:443
Proxy-Authorization: NTLM TlRMTVNTUAABAAAAAgIAAAAAAAAgAAAAAAAAACAAAAA=
User-Agent: PycURL/7.14.0
Proxy-Connection: Keep-Alive
Content-type: text/xml; charset="UTF-8"
SOAPAction: "disconnect"
< HTTP/1.0 407 Proxy Authentication Required
< Server: squid/2.5.STABLE10
< Mime-Version: 1.0
< Date: Thu, 30 Jun 2005 17:36:32 GMT
< Content-Type: text/html
< Content-Length: 1313
< Expires: Thu, 30 Jun 2005 17:36:32 GMT
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
< Proxy-Authenticate: NTLM
TlRMTVNTUAACAAAAAAAAADAAAAASAgAA2T1OBbZkyCEAAAAAAAAAA
AAAAAAwAAAA
< X-Cache: MISS from trumpet.fluent.com
< Proxy-Connection: keep-alive
<
* Proxy auth using NTLM with user 'mydomain\myusername'
> CONNECT https_server:443 HTTP/1.0
Host: https_server:443
Proxy-Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAEsAAAAYABgAYwAAAAgACABAAAAAAwADAE
gAAAAAAAAASwAAAAAAAAB7AAAAAYIAAGZsdWVudG5oYXdiMeS4AZ3n7/CFTkMtelXzbgi3+tvBxGW4An
v9G8YDuthEtn/QjxQXffUfykBxd6EW
User-Agent: PycURL/7.14.0
Proxy-Connection: Keep-Alive
Content-type: text/xml; charset="UTF-8"
SOAPAction: "disconnect"
< g yourself or
< change your defau
lt password.
< </P>
<
* Received HTTP code 407 from proxy after CONNECT
* Closing connection #0
>
> And no, I've not seen this before.
>
-- ************************************ Andrew Bushnell Lead Development Engineer Fluent Inc. 10 Cavendish Court Centerra Resource Park Lebanon, NH 03766 awb_at_fluent.com Phone: 603-643-2600, ext. 757 Fax: 603-643-1721 www.fluent.com ************************************ _______________________________________________ http://cool.haxx.se/mailman/listinfo/curl-and-pythonReceived on 2005-06-30