cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Squid proxy authentication problem

From: Sparks, James <james.sparks_at_oce.com>
Date: Fri, 13 Feb 2009 14:48:00 -0700

Thanks for the reply. That is an error I introduced last night after
upgrading to Curl 7.19.3. I had been using, without success, the older
option CURLOPT_PROXYUSERPWD. After changing to:

curl_easy_setopt(m_CurlHandle, CURLOPT_PROXYUSERNAME, "user1");
curl_easy_setopt(m_CurlHandle, CURLOPT_PROXYPASSWORD, "*****");

I still had a problem with NTLM authentication. When we reconfigured
our test Squid server to basic authentication we were able to get
through the proxy. We were finally able to get NTLM authentication to
work by specifying the machine name as part of the user name (I think
domain name may also work):

curl_easy_setopt(m_CurlHandle, CURLOPT_PROXYUSERNAME,
"machine_name\\user1");
curl_easy_setopt(m_CurlHandle, CURLOPT_PROXYPASSWORD, "*****");

It has to do with how Microsoft gives network users full names. I hope
this helps someone.
Thanks again.

James

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Dan Fandrich
Sent: Thursday, February 12, 2009 9:38 PM
To: curl-library_at_cool.haxx.se
Subject: Re: Squid proxy authentication problem

On Thu, Feb 12, 2009 at 05:37:37PM -0700, Sparks, James wrote:
> 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.

If that username and password is for the proxy, not the remote site,
then
you need to use the CURLOPT_PROXYUSERPWD (or CURLOPT_PROXYUSERNAME &
CURLOPT_PROXYPASSWORD) options instead. Note also that you've given away
your password in the log file you sent.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address
service
          Let webmasters know that your web site has moved
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