cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libCurl not sending basic authentication in 1 out of 300 systems...

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 29 Nov 2008 07:27:50 +0100 (CET)

On Fri, 28 Nov 2008, Paul Bergen wrote:

>> GET /low=/SnapshotJPEG?Resolution=320x240&Quality=Standard HTTP/1.1
>> Authorization: Basic ZGNlYWRtaW46ZGNlcGFzcw==
>> User-Agent: curl/7.17.1 (mipsel-unknown-linux-gnu) libcurl/7.17.1

> or change the username/pass, I get a 401. So I know the user/pass are ok.
> Now, I do the same thing with libCurl, and this libCurl is the same version
> as the command line version, compiled from the same source tree at the same
> time, so there should be no difference:

> HTTP/1.1/SnapshotJPEG?Resolution=320x240&Quality=Standard
> Authorization: Basic ZGNlYWRtaW46ZGNlcGFzcw==

The GET line looks totally ruined here but I assume that was a copy and paste
mistake.

The Authorization: header is as we all can see identical to the command line
version so thus my conclusion is that this problem is harder than this.

> So, libCurl and the command line both report virtually identical headers.
> Both are using the same options. And on 299 out of 300 systems everything
> works ok. But, on this one system, for some unknown reason, I keep getting
> 401 errors from libCurl, as though it's not passing the username and pass.

Right. But since it is sending identical headers I would probably suggest you
go low-level and wireshark the connection or similar to possibly detect
differences...

> I was trying to find a way to get curl and libcurl to report the complete
> set of data on the http socket for debug purposes. But it seems neither the
> -v on the command line or CURLOPT_DEBUGFUNCTION for libCurl show you
> everything because even when it's working from the command line, I can see
> that nowhere in the debug output does it show where curl is sending the
> username/password for authentication.

--trace and --trace-ascii are the command line alternatives that show the same
info CURLOPT_DEBUGFUNCTION does. And that is _everything_ sent and received.
If you check the Authorization header again and paste the base64 encoded chunk
in a site like
http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx you'll
see that it _is_ sending the name and password.

> The term 'dceuser' doesn't even appear in the output when I run curl -v.
> So it's not showing me everything that it's sending.

'dceadmin' it is!

-- 
  / daniel.haxx.se
Received on 2008-11-29