cURL / Mailing Lists / curl-library / Single Mail



From: Dan Fandrich <>
Date: Thu, 5 Mar 2015 22:44:38 +0100

On Thu, Mar 05, 2015 at 06:28:24PM +0000, Gary Hostetler (ghostetl) wrote:
> I have a couple of questions regarding this option.
> 1. If I DO NOT set the CURLOPT_HTTPAUTH option and then use the
> curl_easy_perform to send a URL, will CURL default to send BASIC or will CURL
> not send any authentication at all?

The option is documented as:

  CURLAUTH_BASIC: HTTP Basic authentication. This is the default choice...

i.e. If you request authentication (by setting a username/password) then Basic
authentication is what's used unless it's changed.

> 2. If no authentication is sent in question 1 and the server responds
> with a message dictating the need for authentication, for example BASIC, will
> CURL then respond with BASIC authentication? Or will it hold to the fact that
> authentication has not been set and close the connection?


> 3. If the CURLOPT_USERPWD is set with a username/password I understand
> how it is used when specifying CURLOPT_HTTPAUTH, but back to my first two
> questions, is it dependent on CURLOPT_HTTPAUTH? Or is there a case where it is
> provisioned without CURLOPT_HTTPAUTH and will still be used to help default to
> BASIC Authentication.

The value CURLOPT_HTTPAUTH determines which authentication method is used (when
authentication is enabled), and that option defaults to Basic.

>>> Dan
List admin:
Received on 2015-03-05