-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
8u66, 9
-
generic
-
generic
A DESCRIPTION OF THE REQUEST :
Now, we use the code below to use proxy in URLConnection. But the Authenticator is JVM global, not bind to a specific URLConnection. But actually we need to access different proxy(with different Authenticator) in applications.
Authenticator.setDefault(
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
authUser, authPassword.toCharArray());
}
}
);
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080));
conn = new URL(urlString).openConnection(proxy);
JUSTIFICATION :
the concept of model of proxy Authenticator is built not correctly.
Now, we use the code below to use proxy in URLConnection. But the Authenticator is JVM global, not bind to a specific URLConnection. But actually we need to access different proxy(with different Authenticator) in applications.
Authenticator.setDefault(
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
authUser, authPassword.toCharArray());
}
}
);
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080));
conn = new URL(urlString).openConnection(proxy);
JUSTIFICATION :
the concept of model of proxy Authenticator is built not correctly.
- duplicates
-
JDK-8169495 Add a method to set an Authenticator on a HttpURLConnection.
-
- Resolved
-
- relates to
-
JDK-8169495 Add a method to set an Authenticator on a HttpURLConnection.
-
- Resolved
-