我已按照以下说明将fiddler设置为需要身份验证的代理服务器。
当我显式设置凭据时,我在Fiddler中设置了凭据HttpClientHandler
:
this.Proxy = WebRequest.DefaultWebProxy;
this.Proxy.Credentials = new NetworkCredential("sweet name", "sweet password");
然后在Fiddler中,我收到2个http请求,一个407和一个自动200,该请求成功:
但是,当我尝试使用默认凭据时:
this.Proxy = WebRequest.DefaultWebProxy;
this.Proxy.Credentials = CredentialCache.DefaultCredentials;
然后在Fiddler中,我仅收到一个请求,即407,而该请求失败:
为什么没有像我明确设置代理凭据时那样使用默认凭据自动重试?
正如@Robert在评论中指出的那样,该文档说:
The DefaultCredentials property applies only to NTLM, negotiate, and Kerberos-based authentication.
因此,当代理使用基本身份验证时,在407响应之后没有自动第二个http请求是有意义的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句