cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Infinite loop behaviour with libcurl + FTP + proxy + NTLM authentication

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 14 Apr 2009 20:23:12 +0200 (CEST)

On Tue, 14 Apr 2009, Pramod Sharma wrote:

> curl.exe --verbose
> ftp://172.16.220.59:21/teststat.xml<ftp://172.16.220.59:21/teststat.xml>--proxy
> f
> tp://172.16.220.59:8080 <ftp://172.16.220.59:8080> --proxy-user <some cred>
> --proxy-ntlm
>
> * About to connect() to proxy 172.16.220.59 port 8080 (#0)
> * Trying 172.16.220.59... connected
> * Connected to 172.16.220.59 (172.16.220.59) port 8080 (#0)
> * Proxy auth using NTLM with user '172.16.220.59\administrator'
>> GET ftp://172.16.220.59:21/teststat.xml <ftp://172.16.220.59/teststat.xml>HTTP/1.1> Proxy-Authorization: NTLM
> TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGAHAXAAAADw==> User-Agent:
> curl/7.19.4 (i386-pc-win32) libcurl/7.19.4> Host: 172.16.220.59:21> Accept:
> */*> Proxy-Connection: Keep-Alive> % Total % Received % Xferd Average
> Speed Time Time Time Current
> Dload Upload Total Spent Left
> Speed
>
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
> 0< HTTP/1.1 407 Proxy Authentication Required ( Access is denied. )< Via:
> 1.1 TESTSERVER< Proxy-Authenticate: NTLM
> TlRMTVNTUAACAAAAFAAUADgAAAA1goriuAn3Tp92AOMAAAAAAAAAAGQAZABMAAAABQLODgAAAA9NAEMAQQBGAEUARQBBAE4ASQBMAAIAFABNAEMAQQBGAEUARQBBAE4ASQBMAAEAFABNAEMAQQBGAEUARQBBAE4ASQBMAAQAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAMAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAAAAAA=<
> Connection: Keep-Alive< Proxy-Connection: Keep-Alive< Pragma: no-cache<
> Cache-Control: no-cache< Content-Type: text/html< Content-Length: 0 <
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
> 0* Closing connection #0
> * Issue another request to this URL: 'ftp://172.16.220.59:21/teststat.xml'
> * About to connect() to proxy 172.16.220.59 port 8080 (#0)
> * Trying 172.16.220.59... connected
> * Connected to 172.16.220.59 (172.16.220.59) port 8080 (#0)
> * Proxy auth using NTLM with user '172.16.220.59\administrator'
>> GET ftp://172.16.220.59:21/teststat.xml <ftp://172.16.220.59/teststat.xml>HTTP/1.1> Proxy-Authorization: NTLM
> TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGAHAXAAAADw==> User-Agent:
> curl/7.19.4 (i386-pc-win32) libcurl/7.19.4> Host: 172.16.220.59:21> Accept:
> */*> Proxy-Connection: Keep-Alive> < HTTP/1.1 407 Proxy Authentication
> Required ( Access is denied. )< Via: 1.1 TESTSERVER< Proxy-Authenticate:
> NTLM
> TlRMTVNTUAACAAAAFAAUADgAAAA1goriVrzZi/1IW74AAAAAAAAAAGQAZABMAAAABQLODgAAAA9NAEMAQQBGAEUARQBBAE4ASQBMAAIAFABNAEMAQQBGAEUARQBBAE4ASQBMAAEAFABNAEMAQQBGAEUARQBBAE4ASQBMAAQAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAMAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAAAAAA=<
> Connection: Keep-Alive< Proxy-Connection: Keep-Alive< Pragma: no-cache<
> Cache-Control: no-cache< Content-Type: text/html< Content-Length: 0 <
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
> 0

...

> * Closing connection #0

This last line is the indicator of this bug. Since NTLM is authenticating a
connection, it will restart when it gets closed. The big question here is why
libcurl thinks the connection should get closed. I can't see any clues in that
log output!

Can you write up a test case that reproduces this problem?

-- 
  / daniel.haxx.se
Received on 2009-04-14