curl-and-python

hang in post with authenticating proxy

From: Andrew Bushnell <awb_at_fluent.com>
Date: Thu, 23 Jun 2005 15:50:23 -0400

I am working on a problem that while I was doing further investigation
on, I thought I would post a message and see if others have experienced
similar issues etc.

We have client code running on Windows XP that uses PyCurl to connect to
an https site uses HTTP Post requests to talk to a soap api. This all
works well, except I am running into a situation where pycurl is
hanging, apparently awaiting a response from the proxy server.

The circumstances are we have to connect to the HTTPS site via proxy.
The proxy in question is a squid 2.5 proxy server running on a linux
box, not sure exactly what os. Anyway, if that server is setup for NTLM
authentication, then when the post request is sent, the client app
hangs. It is hangs. The output from the .peform looks as follows:

* About to connect() to myproxy port 3128
* Connected to myproxy port 3128
* Establish HTTP proxy tunnel to myhttpsserver:443
* Proxy auth using NTLM with user 'mydomain\myusername'
> CONNECT myhttpsserver:443 HTTP/1.0
Host: myhttpsserver:443
Proxy-Authorization: NTLM ntlmdata
User-Agent: PycURL/7.14.0
Proxy-Connection: Keep-Alive
Content-type: text/xml; charset="UTF-8"
Content-length: 598
SOAPAction: "connect"

< HTTP/1.0 407 Proxy Authentication Required
< Server: squid/2.5.STABLE10
< Mime-Version: 1.0
< Date: Thu, 23 Jun 2005 18:48:48 GMT
< Content-Type: text/html
< Content-Length: 1313
< Expires: Thu, 23 Jun 2005 18:48:48 GMT
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
< Proxy-Authenticate: NTLM ntlmdata
< X-Cache: MISS from myproxyserver
< Proxy-Connection: keep-alive
<
* Proxy auth using NTLM with user 'mydomain\myusername'
> CONNECT myhttpsserver:443 HTTP/1.0
Host: myhttpsserver:443
Proxy-Authorization: NTLM ntlmdata
User-Agent: PycURL/7.14.0
Proxy-Connection: Keep-Alive
Content-type: text/xml; charset="UTF-8"
Content-length: 598
SOAPAction: "connect"

what I am finding is that I use a read callback to provide the post
callback data and my callback is never getting called so it appears that
pycurl (libcurl) is hung prior to getting my data.

Has anyone experienced any problems or know of any bugs? Again, it is a
squid 2.5 server using NTLM authentication.

it is pycurl 7.14.

The tunneling/soap post works fine with the same server when the server
is set for Basic authentication or of course no authentication.

I am looking at emulating my python via the 7.14 curl to see if I can
replicate it natively and hopefully gain some insight that way.

Thanks in advance.

-- 
************************************
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-python
Received on 2005-06-23