Azure / Azure/azure-documentdb-java

How to use with proxy username and password ?

Ouverte
#76 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
investigating
Langage dominant
Java
Étoiles
51
Forks
52
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.