cURL / Mailing Lists / curl-and-php / Single Mail


Re: Digest Authentication in php curl

From: Daniel Stenberg <>
Date: Thu, 16 Aug 2007 09:11:57 +0200 (CEST)

On Wed, 15 Aug 2007, Luke Painter wrote:

> I'm trying to use curl for digest authentication but I'm getting timeouts.
> Is it possible to use php curl for digest authentication?

Yes indeed.

> I followed a thread about digest authentication for the c api so I know it's
> available in the library directly.


> $headers[] = 'Accept: */*';

This is already done by libcurl itself.

> $headers[] = "Content-Length: $lengh";

I strongly advice to not set this, as you confuse libcurl greatly if you set
the wrong size. libcurl (or possibly the binding layer) will set this header
by itself to the actual length of the data you pass in anyway.

> curl_setopt($poster, CURLOPT_CONNECTTIMEOUT, 2);

This seems very strict.

> curl_setopt($poster, CURLOPT_CUSTOMREQUEST, 'POST');


For further analysis, please state your libcurl version, your operating system
and how us what response headers you get from this request (CURLOPT_VERBOSE
might help you).

  Commercial curl and libcurl Technical Support:
Received on 2007-08-16