cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with NTLM AUTH

From: Dlpnet <dlpnet_at_gmail.com>
Date: Mon, 13 Sep 2010 13:31:34 +0200

Hello All,

I m trying to add proxy support to my application using libcurl.
Though everything works well using Basic Auth I cannot make it work
with NTLM. I tried to google some information and I saw some others
had qui te the same problem some time ago but I couldn t find the
solution.

So first of all my config:
libcurl version 7.20
OS: Win (XP/Vista)
C++, VS 9
Proxy Server: Squid 2.7 on Win7

I tested the NTLM authentication with Firefox/Chrome and IE and I can
access the internet trhough the proxy using NTLM. But I cannot
guarantee the problem is coming from the libcurl, so you can find
hereafter the logs of my request.
Could it be as simple as the login/password are not correct ? If yes,
is there anything specific to do for NTLM auth (comparing to Digest)

Thanks a lot,

Dlp

The code I m using is for configuring the proxy is:
curl_easy_setopt(theCurl, CURLOPT_PROXY, url.c_str());
curl_easy_setopt(theCurl, CURLOPT_PROXYUSERPWD, auth.c_str());
curl_easy_setopt(theCurl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);

And the logs are:

* About to connect() to proxy 10.146.27.59 port 3128 (#0)
* Trying 10.146.27.59... * Connected to 10.146.27.59 (10.146.27.59) port 3128
(#0)
> GET http://s3.amazonaws.com/bucket/files%2Fdummy%5Fdonotdelete%2Etxt HT
TP/1.0
Host: s3.amazonaws.com
Proxy-Connection: Keep-Alive
Authorization: AWS XXX:YYY
Date: Mon, 13 Sep 2010 11:16:25 GMT

* HTTP 1.0, assume close after body
< HTTP/1.0 407 Proxy Authentication Required
< Server: squid/2.7.STABLE8
< Date: Mon, 13 Sep 2010 11:16:25 GMT
< Content-Type: text/html
< Content-Length: 1517
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
< Proxy-Authenticate: NTLM
< Connection: close
<
* Expire cleared
* Closing connection #0
* Issue another request to this URL: 'http://s3.amazonaws.com/bucket/file
s%2Fdummy%5Fdonotdelete%2Etxt'
* About to connect() to proxy 10.146.27.59 port 3128 (#0)
* Trying 10.146.27.59... * Connected to 10.146.27.59 (10.146.27.59) port 3128
(#0)
* Proxy auth using NTLM with user 'MyDomain\MyLogin'
> GET http://s3.amazonaws.com/bucket/files%2Fdummy%5Fdonotdelete%2Etxt HT
TP/1.0
Proxy-Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGAHIXAAAADw
==
Host: s3.amazonaws.com
Proxy-Connection: Keep-Alive
Authorization: AWS XXX:YYY
Date: Mon, 13 Sep 2010 11:16:25 GMT

* HTTP 1.0, assume close after body
< HTTP/1.0 407 Proxy Authentication Required
< Server: squid/2.7.STABLE8
< Date: Mon, 13 Sep 2010 11:16:26 GMT
< Content-Type: text/html
< Content-Length: 1517
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
< Proxy-Authenticate: NTLM TlRMTVNTUAACAAAABgAGADgAAAA1goniPimvsHf3BaIAAAAAAAAAA
MAAwAA+AAAABgGwHQAAAA9BAEQAUwACAAYAQQBEAFMAAQAaAE4ARQBVAEMAWgBDADAAMgA2ADQARwBXA
DcABAAgAGEAZABzAC4AYQB1AHQAbwBkAGUAcwBrAC4AYwBvAG0AAwA8AE4ARQBVAEMAWgBDADAAMgA2A
DQARwBXADcALgBhAGQAcwAuAGEAdQB0AG8AZABlAHMAawAuAGMAbwBtAAUAIABhAGQAcwAuAGEAdQB0A
G8AZABlAHMAawAuAGMAbwBtAAcACAA9HukaNVPLAQAAAAA=
* HTTP/1.0 connection set to keep alive!
< Connection: keep-alive
* HTTP/1.0 proxy connection set to keep alive!
< Proxy-Connection: keep-alive
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host 10.146.27.59 left intact
* Issue another request to this URL: 'http://s3.amazonaws.com/bucket/file
s%2Fdummy%5Fdonotdelete%2Etxt'
* Re-using existing connection! (#0) with host 10.146.27.59
* Connected to 10.146.27.59 (10.146.27.59) port 3128 (#0)
* Proxy auth using NTLM with user 'MyDomain\MyLogin'
> GET http://s3.amazonaws.com/bucket/files%2Fdummy%5Fdonotdelete%2Etxt HT
TP/1.0
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAIoAAAAwATABogAAABAAEABYAAAADgAOAG
gAAAAUABQAdgAAABAAEADSAQAANYKI4gYAchcAAAAPiw0jSsRRlI9QjKtd/d5Lck0AeQBEAG8AbQBhAG
kAbgBNAHkATABvAGcAaQBuAFMATwBQAC0ATgBFAEcAUgBJAFMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAJBpOKvuJQSbdRllF3BwuSwEBAAAAAAAAPR7pGjVTywEOTE5SAV/CGgAAAAACAAYAQQBEAFMAAQAaAE
4ARQBVAEMAWgBDADAAMgA2ADQARwBXADcABAAgAGEAZABzAC4AYQB1AHQAbwBkAGUAcwBrAC4AYwBvAG
0AAwA8AE4ARQBVAEMAWgBDADAAMgA2ADQARwBXADcALgBhAGQAcwAuAGEAdQB0AG8AZABlAHMAawAuAG
MAbwBtAAUAIABhAGQAcwAuAGEAdQB0AG8AZABlAHMAawAuAGMAbwBtAAcACAA9HukaNVPLAQYABAACAA
AACAAwADAAAAAAAAAAAAAAAAAwAADWgDmOD7pl9mdigFoypIvnXEVXDnetoUm15gT1s++g5QAAAAAAAA
AAAAAAADRKDAj336+AzGKf4AR07UI=
Host: s3.amazonaws.com
Proxy-Connection: Keep-Alive
Authorization: AWS XXX:YYY
Date: Mon, 13 Sep 2010 11:16:25 GMT

* HTTP 1.0, assume close after body
< HTTP/1.0 407 Proxy Authentication Required
< Server: squid/2.7.STABLE8
< Date: Mon, 13 Sep 2010 11:16:26 GMT
< Content-Type: text/html
< Content-Length: 1517
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
* Authentication problem. Ignoring this.
< Proxy-Authenticate: NTLM
< Connection: close
<
* Closing connection #0
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-13