curl-library
ntlm proxy authentication with isa server
Date: Thu, 12 Apr 2007 18:36:01 +0200
Hi All!
Maybe I'm doing something wrong, but I can't get NTLM proxy authentication to work with libcurl (or something wrong with the ISA proxy server).
As you can see in the sample conversation, the initial ntlm message was sent, and I received the response also, but the last message won't go out (where username, and password should go out). (If I turn on proxy_redirection, then libcurl sends the last message to the server, but this ISA server does not support CONNECT.)
Can anybody tell me, why?
Thanx all Your help!
Best regards,
Tamas
Code snippet:
curl_easy_setopt (curl, CURLOPT_DEBUGDATA, ctx);
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION,curl_debug_cb);
curl_easy_setopt(curl, CURLOPT_URL, "www.xxx.com");
curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_NTLM );
curl_easy_setopt(curl, CURLOPT_PROXY, "http:// TESZT.ELEK:1234_at_1.2.3.4:8000");
curl_easy_setopt (curl, CURLOPT_USERAGENT, "UserAgent");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)response);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1);
curl_easy_setopt(curl,CURLOPT_HTTPGET,1);
cres = curl_easy_perform(network_ctx->curl);
Sample conversation (not with actual data)
About to connect() to proxy 123.123.123.123 port 8080 (#0)
Trying 123.123.123.123... connected
Connected to 123.123.123.123 (123.123.123.123) port 8080 (#0)
Proxy auth using NTLM with user 'TESZT.ELEK'
GET http://www.microsoft.com/ HTTP/1.1
Proxy-Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAFASgKAAAADw==
User-Agent: UserAgent
Host: www.microsoft.com
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive
HTTP/1.1 407 Proxy Authentication Required ( Access is denied. )
Via: 1.1 AAAA00
Proxy-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADgAAAA1goniHPBnlvDjTEQAAAAAAAAAAIgAiABAAAAA
BQLODgAAAA9BAEEAQQBBAAIACABBAEEAQQBBAAEADABCAEIAQgBCADAAMAAEABoA
aABoAC4AYQBhAGEAYQAuAGwAbwBjAGEAbAADACgAYgBiAGIAYgBiAGIALgBoAGgA
LgBhAGEAYQBhAC4AbABvAGMAYQBsAAUAGgBoAGgALgBhAGEAYQBhAC4AbABvAGMA
YQBsAAAAAAA=
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 0
Connection #0 to host 123.123.123.123 left intact
Maximum (0) redirects followed
Closing connection #0
_______________________________________________________________________
Ezt az e-mailt virus- es SPAM-szuresnek vetettuk ala a filter:mail MessageLabs rendszerrel. Tovabbi informacio: http://www.filtermax.hu
This email has been scanned for viruses and SPAM by the filter:mail MessageLabs System. More information: http://www.filtermax.hu ________________________________________________________________________________________
Received on 2007-04-12