cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP Authentication failed!! (hui)

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 21 Dec 2011 10:58:28 -0800

On Wed, Dec 21, 2011 at 05:31:42PM +0800, hui wrote:
> following is options set:
>
> curl_easy_setopt(fileData->curl, CURLOPT_HTTPAUTH,
> CURLAUTH_GSSNEGOTIATE); //specify the authentication method
>
> following is debug infos now:
>
> * About to connect() to 89.147.64.204 port 8888 (#0)
> * Trying 89.147.64.204... * Connected to 89.147.64.204 (89.147.64.204) port
> 8888 (#0)
> * Server auth using Basic with user 'etele'
> > GET /RtlKlub HTTP/1.1
>
> Authorization: Basic ZXRlbGU6WGRyNTZ0RmM=

This is not CURLAUTH_GSSNEGOTIATE but rather CURLAUTH_BASIC, so perhaps
your libcurl is (unexpectedly) doesn't support GSSNEGOTIATE but is
rather falling back on BASIC.

> User-Agent: TechniSat Mediaplayer (CE-HTML); HbbTV/1.1.1 (; ; ; ; ; )
> Host: 89.147.64.204:8888
> Accept: */*
>
> < HTTP/1.1 200 OK

But, as I surmised, the server allows the request now, which means that the
403 error code it sent before was bogus--it should have sent 401. With a 401
code it would have also sent a list of supported authentication methods.

> < Content-type: application/octet-stream
> MIME PROPERTIES : 14539e5 | application/octet-stream
> |
> -Other MIME
> < Cache-Control: no-cache
> < Server: MCast server 0.1
> < Accept-Ranges: bytes
> < Allow: GET
> * no chunk, no close, no size. Assume close to signal end
> * Closing connection #0

And clearly, this server is very broken. It responds with an HTTP/1.1
response version, but it doesn't send a Content-Length: header and doesn't
specify chunked encoding. So, libcurl falls back to treating it like an
HTTP/1.0 response and hope for the best. But, it appears the server closes
the connection before sending any data.

You could try specifying HTTP/1.0 in the CURLOPT_HTTP_VERSION option
and perhaps the server will do something different. But, you're probably
better off using a packet tracing tool like Wireshark to see what a VLC
request to this server looks like and make sure that your app is setting
all the correct options to emulate that request.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-21