Using curl to test authentication methods through web proxy (basic, ntlm, kerberos)

Verze pro tiskPDF verze

This is just quick note because I'm re-discovering it every time when needed :]

# Using Basic authentication
curl -vvv --proxy-basic --proxy-user 'DOMAIN\user'

# Using Digest authentication
curl -vvv --proxy-digest --proxy-user 'DOMAIN\user'

# Using NTLM
curl -vvv --proxy-ntlm --proxy-user 'DOMAIN\user'

# If you use an SSPI-enabled curl binary your username can be picked up from environment
curl -vvv --proxy-ntlm --proxy-user :

# Kerberos authentication
curl -vvv --proxy-negotiate --proxy-user 'DOMAIN\user'

If backend server needs authentication, option --user has to be used

curl -vvv --user 'DOMAIN\user:password'

To use different proxy instead of $http_proxy variable, use --proxy $proxyname:$port