7

I have been using curl for some time now and its working fine but with a proxy which uses users 'domain\username' to authenticate curl fails asking for Authorization. Authorization method is NTLM. This code goes in a batch file.

Code:

curl --proxy-ntlm --proxy-user : --proxy %PROXY_URL% --user %Username%:%Password% -f -O --url "%SITE_URL%"

Curl Version:

curl 7.30.0 (i386-pc-win32) libcurl/7.30.0 OpenSSL/1.0.1c zlib/1.2.7 Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile NTLM SSL libz

I was under the impression that using ':' would pass on the NT Login credentials to the server. But this doesn't seem to work, when i put 'domain\username:password' instead of ':' it goes through fine. Using only 'username:password' instead of ':' results in the same 'Requires Proxy Authorization'. Any suggestions ?

PS: The proxy authenticates using the userdomain along with the username .. any suggestions on how to pass this ? If not cURL i am open for alternatives.

Telson Alva
  • 842
  • 6
  • 22
  • 37
  • Possible duplicate of [NTLM proxy without password?](https://stackoverflow.com/questions/1276955/ntlm-proxy-without-password) – Liam Aug 07 '18 at 13:28

2 Answers2

18

I had the same problem and following command worked for me:

curl --proxy-ntlm --proxy-user %Username%:%Password% --proxy %PROXY_URL%:%PORT% %SITE_URL%

I didn't use domain name, just username.

Charles Liu
  • 271
  • 1
  • 2
  • 7
1

This is years late, but I came across this issue and I had to put quotes around the :

curl --proxy-ntlm --proxy-user ":" --proxy %PROXY_URL% --user %Username%:%Password% -f -O --url "%SITE_URL%"
Stavr00
  • 3,219
  • 1
  • 16
  • 28