Azure / Azure/azure-documentdb-java

How to use with proxy username and password ?

未关闭
#76 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
investigating
主要语言
Java
星标
51
派生
52
PR 合并指标
30 天内没有已合并 PR

描述

Hii,
I am working behind the proxy network.
I tried arguments like following but it is not working.
```
-Dhttp.proxyHost=myproxy Dhttp.proxyPort=3128
-Dhttps.proxyHost=myproxy -Dhttps.proxyPort=3128
```
Following allows me add host and port of proxy, but I required to username and password as well.
`connectionPolicy.setProxy(new HttpHost(InetAddress.getByName("proxy.company.com"), 12345));`

I also tried following for authentication
```
final String authUser = "user";
final String authPassword = "password";
Authenticator.setDefault(
new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
authUser, authPassword.toCharArray());
}
}
);

System.setProperty("http.proxyUser", authUser);
System.setProperty("http.proxyPassword", authPassword);
```
How can I use username and password for authentication for proxy.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。