cURL / Mailing Lists / curl-library / Single Mail

curl-library

Squid proxy authentication problem

From: Sparks, James <james.sparks_at_oce.com>
Date: Thu, 12 Feb 2009 17:37:37 -0700

I'm having a problem getting Proxy authentication from our Squid server (squidNT/2.7.STABLE5). I'm using libCurl version 7.19.3. The Curl proxy options currently set are (company passwords replaced by *****):
   curl_easy_setopt(m_CurlHandle, CURLOPT_PROXY, "http://10.10.1.46:3128/");
   curl_easy_setopt(m_CurlHandle, CURLOPT_USERNAME, "user1");
   curl_easy_setopt(m_CurlHandle, CURLOPT_PASSWORD, "*****");
   curl_easy_setopt(m_CurlHandle, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
The response code returned by curl_easy_perform is CURLE_OK.
I hard link with the libCurl and OpenSSL libraries and am building on a Windows platform using VS 2005.

Here is my log file with curl verbose turned on:
[
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 info text:
About to connect() to proxy 10.10.1.46 port 3128 (#0)
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 info text:
  Trying 10.10.1.46... [00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 info text:
connected
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 info text:
Connected to 10.10.1.46 (10.10.1.46) port 3128 (#0)
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 info text:
Server auth using Basic with user 'ort-srv-proxy2\user1'
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 header out:
POST http://odc.bluespot.com/User/Login HTTP/1.1
Authorization: Basic b3J0LXNydi1wcm94eTJcdXNlcjE6Rmxvd2VycG90MQ==
Host: odc.bluespot.com
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 66
Content-Type: application/x-www-form-urlencoded

[00001774:00000b2c] 2009-02-12 17:33:07.670 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 data out:
9JRS  2.3.0.281 T o m U s e r 1 [00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 info text:
HTTP 1.0, assume close after body
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
HTTP/1.0 407 Proxy Authentication Required
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Server: squid/2.7.STABLE5
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Date: Fri, 13 Feb 2009 00:33:07 GMT
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Content-Type: text/html
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Content-Length: 1396
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Proxy-Authenticate: NTLM
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
X-Cache: MISS from ort-srv-proxy2.test.local
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
X-Cache-Lookup: NONE from ort-srv-proxy2.test.local:3128
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Via: 1.0 ort-srv-proxy2.test.local:3128 (squid/2.7.STABLE5)
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:
Connection: close
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 header in:

[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 data in:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: Cache Access Denied</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD>
<BODY>
<H1>ERROR</H1>
<H2>Cache Access Denied</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://odc.bluespot.com/User/Login">http://odc.bluespot.com/User/Login</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Cache Access Denied.
</STRONG>
</UL>
</P>

<P>Sorry, you are not currently allowed to request:
<PRE> http://odc.bluespot.com/User/Login</PRE>
from this cache until you have authenticated yourself.
</P>

<P>
You need to use Netscape version 2.0 or greater, or Microsoft Internet
Explorer 3.0, or an HTTP/1.1 compliant browser for this to work. Please
contact the <A HREF="mailto:webmaster">cache administrator</a> if you have
difficulties authenticating yourself or
<A HREF="http://ort-srv-proxy2.test.local/cgi-bin/chpasswd.cgi">change</a> your default password.
</P>

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Fri, 13 Feb 2009 00:33:07 GMT by ort-srv-proxy2.test.local (squid/2.7.STABLE5)
</ADDRESS>
</BODY></HTML>
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 Begin CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 info text:
Closing connection #0
[00001774:00000b2c] 2009-02-12 17:33:07.686 -700 End CurlVerbose
[00001774:00000b2c] 2009-02-12 17:33:11.298 -700 CurlLib: User/Login, Curl lib response [0] CURLE_OK
[00001774:00000b2c] 2009-02-12 17:33:11.298 -700 ORD response code [4] ResponseNotExpected
[00001774:00000b2c] 2009-02-12 17:33:11.298 -700 Unexpected server return:
[1396]
{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: Cache Access Denied</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD>
<BODY>
<H1>ERROR</H1>
<H2>Cache Access Denied</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://odc.bluespot.com/User/Login">http://odc.bluespot.com/User/Login</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Cache Access Denied.
</STRONG>
</UL>
</P>

<P>Sorry, you are not currently allowed to request:
<PRE> http://odc.bluespot.com/User/Login</PRE>
from this cache until you have authenticated yourself.
</P>

<P>
You need to use Netscape version 2.0 or greater, or Microsoft Internet
Explorer 3.0, or an HTTP/1.1 compliant browser for this to work. Please
contact the <A HREF="mailto:webmaster">cache administrator</a> if you have
difficulties authenticating yourself or
<A HREF="http://ort-srv-proxy2.test.local/cgi-bin/chpasswd.cgi">change</a> your default password.
</P>

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Fri, 13 Feb 2009 00:33:07 GMT by ort-srv-proxy2.test.local (squid/2.7.STABLE5)
</ADDRESS>
</BODY></HTML>
}

Thanks

This message and attachment(s) are intended solely for use by the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

If you have received this communication in error, please notify the sender immediately by telephone and with a 'reply' message.

Thank you for your co-operation.
Received on 2009-02-13