Apache HttpClient 4.1 - Proxy Authentication

前端 未结 7 947
走了就别回头了
走了就别回头了 2020-11-30 03:07

I\'ve been trying to configure the user and password for proxy authentication from the configured properties while using Apaches HttpComponent\'s httpclient, but with no suc

相关标签:
7条回答
  • 2020-11-30 04:07

    A simpler thing worked for me for NTLM:

    httpclient.getCredentialsProvider().setCredentials(
                        new AuthScope(proxy_host, proxy_port), 
                        new NTCredentials(this.proxy_user, this.proxy_pass, this.proxy_host, this.proxy_domain));
    HttpHost proxy = new HttpHost(this.proxy_host, this.proxy_port, "http");
    httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    
    0 讨论(0)
提交回复
热议问题