cURL Auth, TLS, and Proxy Security/Auto-negotiate auth method

Let curl probe and select an auth scheme.

Section: Credentials and Sessions

Auto-negotiate auth method

bash
bash
curl --anyauth -u 'user:password' https://example.com/protected
Explanation

Convenient when you do not know the server's auth scheme ahead of time.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Credentials and Sessions
Use credentials from .netrc
Load login credentials from a `.netrc` file.
OpenIn sheetbashsame section
Use a custom netrc file
Read machine credentials from a specific netrc file.
OpenIn sheetbashsame section
HTTP Digest auth
Authenticate with Digest auth if the server supports it.
OpenIn sheetbashsame section
SPNEGO / Negotiate auth
Use Negotiate auth with credentials from the environment or Kerberos setup.
OpenIn sheetbashsame section
Follow redirects and send auth
Follow redirects and keep auth across hosts only when you explicitly trust it.
OpenIn sheetbashsame section
Proxy with basic auth
Authenticate to a proxy with username and password.
OpenIn sheetbash2 tag match