cURL NTLM代理授权 [英] cURL NTLM Proxy Authorization

查看:296
本文介绍了cURL NTLM代理授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用curl有一段时间了,它可以正常工作,但是使用使用用户 domain\username来验证curl的代理时,我无法请求授权。授权方法是NTLM。这段代码位于批处理文件中。

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.

代码:

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

卷发版本:


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 tftp功能:AsynchDNS IPv6大文件
NTLM SSL libz

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

我的印象是,使用':'会将NT登录凭据传递给服务器。但这似乎不起作用,当我输入 domain\username:password而不是:时,就可以了。仅使用用户名:密码而不是:会产生相同的需要代理授权。有任何建议吗?

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:
代理使用userdomain和用户名进行身份验证..有关如何传递此建议的任何建议?如果不是cURL,则我愿意接受替代方法。

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.

推荐答案

我遇到了同样的问题,以下命令对我有用:

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 NTLM代理授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆