Skip to content

Commit

Permalink
8262442: (windows) Use all proxy configuration sources when java.net.…
Browse files Browse the repository at this point in the history
…useSystemProxies=true

Reviewed-by: dfuchs
  • Loading branch information
djelinski authored and dfuch committed Jan 13, 2022
1 parent c17a012 commit 6fcaa32
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/java.base/windows/native/libnet/DefaultProxySelector.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -230,16 +230,12 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
auto_proxy_options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
auto_proxy_options.fAutoLogonIfChallenged = TRUE;
use_auto_proxy = TRUE;
} else if (ie_proxy_config.lpszAutoConfigUrl != NULL) {
}
if (ie_proxy_config.lpszAutoConfigUrl != NULL) {
/* Windows uses PAC file */
auto_proxy_options.lpszAutoConfigUrl = ie_proxy_config.lpszAutoConfigUrl;
auto_proxy_options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
auto_proxy_options.dwFlags |= WINHTTP_AUTOPROXY_CONFIG_URL;
use_auto_proxy = TRUE;
} else if (ie_proxy_config.lpszProxy != NULL) {
/* Windows uses manually entered proxy. */
use_auto_proxy = FALSE;
win_bypass_proxy = ie_proxy_config.lpszProxyBypass;
win_proxy = ie_proxy_config.lpszProxy;
}

if (use_auto_proxy) {
Expand All @@ -254,6 +250,12 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
}
}

if (!use_auto_proxy && ie_proxy_config.lpszProxy != NULL) {
/* Windows uses manually entered proxy. */
win_bypass_proxy = ie_proxy_config.lpszProxyBypass;
win_proxy = ie_proxy_config.lpszProxy;
}

/* Check the bypass entry. */
if (NULL != win_bypass_proxy) {
/*
Expand Down

1 comment on commit 6fcaa32

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.