cURL / Mailing Lists / curl-library / Single Mail


CURLAUTH_ANY causes authention failure

From: Jeroen Ooms <>
Date: Fri, 5 Jun 2015 20:26:23 +0200

For the libcurl bindings in the R programming language, I would like
to user to be able to connect to an arbitrary server using any
authentication method. However setting CURLOPT_HTTPAUTH to
CURLAUTH_ANY actually causes authentication failures in some cases.

Here is an example: This
particular example uses hidden basic auth. It works with the default
CURLOPT_HTTPAUTH but when we set it to CURLAUTH_ANY it fails.

When we change the URL to
we see what happens. When CURLAUTH_ANY is set, curl first performs a
request without Authorization header, and then when the server returns
a 401 it tries again with Authorization header. This doesn't work for
hidden auth because it returns a 404 instead of 401.
List admin:
Received on 2015-06-05