cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Pramod Sharma <pramodsharma08_at_gmail.com>
Date: Tue, 14 Apr 2009 10:54:34 +0530

Hi,
I am seeing the max redirects being reached when downloading from FTP
server through ISA proxy(using NTLM auth) .
The same works while downloading from HTTP server with same proxy and
authentication.

Sorry for this long email but I am trying to give as much info as possible.
My problem lies in the below heading "__CURL FTP with proxy and ntlm auth__"
*.*
Can anyone help me out with this or let me know if I should provide any
other info ?

Configuration
1. FTP server/ HTTP server - IIS
2. ISA Proxy
3. ISA Proxy with NTLM authentication
4. curl version 7.19.4
5. FTP or HTTP server 172.16.220.59 , Proxy server 172.16.220.59:8080

___Curl version___
curl 7.19.4 (i386-pc-win32) libcurl/7.19.4
Protocols: tftp ftp telnet dict ldap http file
Features: Largefile NTLM SSPI

__Curl Ftp without proxy__
curl.exe --verbose ftp://172.16.220.59:21/teststat.xml
  % Total % Received % Xferd Average Speed Time Time Time
Current Dload Upload Total Spent Left
Speed
118 118 0 118 0 0 7375 0 --:--:-- --:--:-- --:--:--
7375
118 118 0 118 0 0 538 0 --:--:-- --:--:-- --:--:--
0<?xml version="1.0" encoding="UTF-8"?>
<TESTXML>Hello We are here</TESTXML>

__Curl HTTP with proxy and NTLM auth__
curl.exe --verbose http://172.16.220.59:80/teststat.xml --proxy
http://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 'administrator'
> GET http://172.16.220.59:80/teststat.xml<http://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

> 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
TlRMTVNTUAACAAAAFAAUADgAAAA1gorit5+by1ysUNcAAAAAAAAAAGQAZABMAAAABQLODgAAAA9NAEMAQQBGAEUARQBBAE4ASQBMAAIAFABNAEMAQQBGAEUARQBBAE4ASQBMAAEAFABNAEMAQQBGAEUARQBBAE4ASQBMAAQAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAMAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAAAAAA=

< 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* Connection #0 to host 172.16.220.59 left intact
* Issue another request to this URL: 'http://172.16.220.59:80/teststat.xml'
* Re-using existing connection! (#0) with host 172.16.220.59
* Connected to 172.16.220.59 (172.16.220.59) port 8080 (#0)
* Proxy auth using NTLM with user 'administrator'
> GET http://172.16.220.59:80/teststat.xml<http://172.16.220.59/teststat.xml>HTTP/1.1

> Proxy-Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAI4AAADIAMgApgAAAAAAAABYAAAAGgAaAFgAAAAcABwAcgAAABAAEABuAQAANYKI4gYAcBcAAAAPYeijekicFyw7G4nQ9DMbkGEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABSAEEATQBPAEQARABFAFYAVgBJAFMAVABBAJ/EIPqIyzj2DKxUlfq+35YcF7eSx9bCyKozNxHFWL9DllRgb+FzCwQBAQAAAAAAALCDRey8vMkBHBe3ksfWwsgAAAAAAgAUAE0AQwBBAEYARQBFAEEATgBJAEwAAQAUAE0AQwBBAEYARQBFAEEATgBJAEwABAAUAG0AYwBhAGYAZQBlAGEAbgBpAGwAAwAUAG0AYwBhAGYAZQBlAGEAbgBpAGwACAAwADAAAAAAAAAAAAAAAAAwAABav+gihsxEUrM46WVrZIKjXEGKv9GuNrJY6YjgeYNCdQAAAAAAAAAAl1zSbUeilkGgvemZZpd9kA==

> User-Agent: curl/7.19.4 (i386-pc-win32) libcurl/7.19.4

> Host: 172.16.220.59

> Accept: */*

> Proxy-Connection: Keep-Alive

>

< HTTP/1.1 200 OK

< Via: 1.1 TESTSERVER

< Connection: Keep-Alive

< Proxy-Connection: Keep-Alive

< Content-Length: 118

< Date: Tue, 14 Apr 2009 04:54:37 GMT

< Content-Type: text/xml

< ETag: "528d1b66f2a9c91:8b6"

< Server: Microsoft-IIS/6.0

< Last-Modified: Sat, 21 Mar 2009 06:58:11 GMT

< Accept-Ranges: bytes

< X-Powered-By: ASP.NET

<

{ [data not shown]

118 118 118 118 0 0 2510 0 --:--:-- --:--:-- --:--:--
2510<?xml version="1.0" encoding="UTF-8"?>
<TESTXML>Hello we are here </TESTXML>
* Connection #0 to host 172.16.220.59 left intact

* Closing connection #0

__CURL FTP with proxy and ntlm auth__

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
* 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
TlRMTVNTUAACAAAAFAAUADgAAAA1goriYKKOx1rMmhsAAAAAAAAAAGQAZABMAAAABQLODgAAAA9NAEMAQQBGAEUARQBBAE4ASQBMAAIAFABNAEMAQQBGAEUARQBBAE4ASQBMAAEAFABNAEMAQQBGAEUARQBBAE4ASQBMAAQAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAMAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAAAAAA=<
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'

...........The content demarcated above keeps repeating for max
redirs..............................................

> 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
TlRMTVNTUAACAAAAFAAUADgAAAA1goriYgC0BPG6+rUAAAAAAAAAAGQAZABMAAAABQLODgAAAA9NAEMAQQBGAEUARQBBAE4ASQBMAAIAFABNAEMAQQBGAEUARQBBAE4ASQBMAAEAFABNAEMAQQBGAEUARQBBAE4ASQBMAAQAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAMAFABtAGMAYQBmAGUAZQBhAG4AaQBsAAAAAAA=<
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
* Maximum (50) redirects followed

curl: (47) Maximum (50) redirects followed

Regards,

Pramod
Received on 2009-04-14