简体   繁体   English

cURL NTLM 代理授权

[英]cURL NTLM Proxy Authorization

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.我已经使用 curl 一段时间了,它工作正常,但是使用用户“域\\用户名”来验证 curl 的代理无法请求授权。 Authorization method is NTLM.授权方式为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 curl 7.30.0 (i386-pc-win32) libcurl/7.30.0 OpenSSL/1.0.1c zlib/1.2.7 协议: dict 文件 ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smtp smtps: telnet tnchDNS 大型 IPv6 NTLM SSL libz

I was under the impression that using ':' would pass on the NT Login credentials to the server.我的印象是使用 ':' 会将 NT 登录凭据传递给服务器。 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 ? PS:代理使用用户域和用户名进行身份验证..关于如何通过这个有什么建议吗? If not cURL i am open for alternatives.如果不是 cURL,我愿意接受其他选择。

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.我没有使用域名,只是用户名。

这已经晚了好几年了,但我遇到了这个问题,我不得不在以下内容周围加上引号:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM