Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8270553: Tests should not use (real, in-use, routable) 1.1.1.1 as dummy IP value #4806

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/jdk/java/net/HttpURLConnection/HttpURLConWithProxy.java
Expand Up @@ -55,7 +55,8 @@ public static void main(String... arg) throws Exception {
// Remove the default nonProxyHosts to use localhost for testing
System.setProperty("http.nonProxyHosts", "");

System.setProperty("http.proxyHost", "1.1.1.1");
// 240.0.0.0/4 is unallocated and "reserved for future use" (RFC 1112, Section 4)
System.setProperty("http.proxyHost", "240.0.0.1");
System.setProperty("http.proxyPort", "1111");

// Use the logger to help verify the Proxy was used
Expand Down Expand Up @@ -131,8 +132,9 @@ class MyProxySelector extends ProxySelector {
List<Proxy> proxies = new ArrayList<>();

MyProxySelector() {
Proxy p1 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("2.2.2.2", 2222));
Proxy p2 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("3.3.3.3", 3333));
// 240.0.0.0/4 is unallocated and "reserved for future use" (RFC 1112, Section 4)
Proxy p1 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("240.0.0.2", 2222));
Proxy p2 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("240.0.0.3", 3333));
proxies.add(p1);
proxies.add(p2);
}
Expand Down