-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 17
-
b06
-
x86_64
-
windows
ADDITIONAL SYSTEM INFORMATION :
Tested with Windows 10, but behavior should be the same in all Windows versions.
A DESCRIPTION OF THE PROBLEM :
When multiple Windows proxy configuration options are selected (automatic detection, setup script address, manual proxy setup), proxy selector only attempts one, and ignores all others.
Proxy selector should try automatic script first, but fall back to configured script and eventually to manual configuration if earlier methods fail. See Microsoft's example: https://support.microsoft.com/en-us/topic/how-the-windows-update-client-determines-which-proxy-server-to-use-to-connect-to-the-windows-update-web-site-08612ae5-3722-886c-f1e1-d012516c22a1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Pick a machine with no automatic proxy configuration (WPAD) available
In proxy configuration select "Automatically detect settings" and "Use a proxy server"; set any proxy server address (I used 127.0.0.1:8192)
[1] Run attached code with -Djava.net.useSystemProxies=true
Deselect "Automatically detect settings"
[2] Run attached code again
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Both runs return configured proxy
ACTUAL -
First run returns [DIRECT], second run returns configured proxy
---------- BEGIN SOURCE ----------
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
public class ProxySel {
public static void main(String[] args) throws URISyntaxException {
ProxySelector sel = ProxySelector.getDefault();
System.out.println(sel.select(new URI("http://example.com")).toString());
}
}
---------- END SOURCE ----------
FREQUENCY : always
Tested with Windows 10, but behavior should be the same in all Windows versions.
A DESCRIPTION OF THE PROBLEM :
When multiple Windows proxy configuration options are selected (automatic detection, setup script address, manual proxy setup), proxy selector only attempts one, and ignores all others.
Proxy selector should try automatic script first, but fall back to configured script and eventually to manual configuration if earlier methods fail. See Microsoft's example: https://support.microsoft.com/en-us/topic/how-the-windows-update-client-determines-which-proxy-server-to-use-to-connect-to-the-windows-update-web-site-08612ae5-3722-886c-f1e1-d012516c22a1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Pick a machine with no automatic proxy configuration (WPAD) available
In proxy configuration select "Automatically detect settings" and "Use a proxy server"; set any proxy server address (I used 127.0.0.1:8192)
[1] Run attached code with -Djava.net.useSystemProxies=true
Deselect "Automatically detect settings"
[2] Run attached code again
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Both runs return configured proxy
ACTUAL -
First run returns [DIRECT], second run returns configured proxy
---------- BEGIN SOURCE ----------
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
public class ProxySel {
public static void main(String[] args) throws URISyntaxException {
ProxySelector sel = ProxySelector.getDefault();
System.out.println(sel.select(new URI("http://example.com")).toString());
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8240701 ProxySelector always returns Type.DIRECT even when a proxy is in use
- Closed
-
JDK-8259529 HTTP Proxy not properly detected using Java 15 on Windows 10
- Closed
- relates to
-
JDK-8289514 ProxySelector should support Chromium's implicit bypass rules
- Open