From 4bed0e280e64d107daaebcaf08996296fdb80261 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Wed, 4 Nov 2026 17:06:22 -0800 Subject: [PATCH 1/2] fix vertx tests when the jvm proxy host is an IP address --- .../http/vertx/VertxHttpClientProviderTests.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientProviderTests.java b/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientProviderTests.java index d60978e70af13..b39c07f31742e 100644 --- a/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientProviderTests.java +++ b/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientProviderTests.java @@ -37,7 +37,7 @@ public class VertxHttpClientProviderTests extends HttpClientOptionsProviderTests public void nullOptionsReturnsBaseClient() { VertxHttpClient httpClient = (VertxHttpClient) new VertxHttpClientProvider().createInstance(null); - ProxyOptions environmentProxy = ProxyOptions.fromConfiguration(Configuration.getGlobalConfiguration()); + ProxyOptions environmentProxy = loadEnvironmentProxy(); io.vertx.core.net.ProxyOptions proxyOptions = httpClient.buildOptions.getProxyOptions(); if (environmentProxy == null) { assertNull(proxyOptions); @@ -52,7 +52,7 @@ public void defaultOptionsReturnsBaseClient() { VertxHttpClient httpClient = (VertxHttpClient) new VertxHttpClientProvider().createInstance(new HttpClientOptions()); - ProxyOptions environmentProxy = ProxyOptions.fromConfiguration(Configuration.getGlobalConfiguration()); + ProxyOptions environmentProxy = loadEnvironmentProxy(); io.vertx.core.net.ProxyOptions proxyOptions = httpClient.buildOptions.getProxyOptions(); if (environmentProxy == null) { assertNull(proxyOptions); @@ -62,6 +62,15 @@ public void defaultOptionsReturnsBaseClient() { } } + /* + * Loads the environment proxy the way VertxHttpClientBuilder does, unresolved. Resolving it would make + * getHostName() perform a reverse DNS lookup when the proxy host is an IP address, returning a name that doesn't + * match the host the client was configured with. + */ + private static ProxyOptions loadEnvironmentProxy() { + return ProxyOptions.fromConfiguration(Configuration.getGlobalConfiguration(), true); + } + @Test public void optionsWithAProxy() { ProxyOptions proxyOptions = new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("localhost", 8888)); From 88dae89203661a353bf109e8da7e38fdd967ce5b Mon Sep 17 00:00:00 2001 From: Isabelle Date: Thu, 5 Nov 2026 09:52:39 -0800 Subject: [PATCH 2/2] adding noproxy change here --- .../core/http/jdk/httpclient/JdkHttpClientBuilderTests.java | 1 + .../com/azure/core/http/vertx/VertxHttpClientBuilderTests.java | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/test/java/com/azure/core/http/jdk/httpclient/JdkHttpClientBuilderTests.java b/sdk/core/azure-core-http-jdk-httpclient/src/test/java/com/azure/core/http/jdk/httpclient/JdkHttpClientBuilderTests.java index 0f5852abb55df..af2b8f5aeae76 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/src/test/java/com/azure/core/http/jdk/httpclient/JdkHttpClientBuilderTests.java +++ b/sdk/core/azure-core-http-jdk-httpclient/src/test/java/com/azure/core/http/jdk/httpclient/JdkHttpClientBuilderTests.java @@ -353,6 +353,7 @@ public void buildWithHttpProxyFromEnvConfiguration() { Configuration configuration = new ConfigurationBuilder(EMPTY_SOURCE, EMPTY_SOURCE, new TestConfigurationSource() .put(Configuration.PROPERTY_HTTP_PROXY, "http://" + PROXY_USER_INFO + "localhost:" + PROXY_SERVER_HTTP_PORT) .put(Configuration.PROPERTY_HTTPS_PROXY, "") + .put(Configuration.PROPERTY_NO_PROXY, "") .put("java.net.useSystemProxies", "true")).build(); configurationProxyTest(configuration); diff --git a/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientBuilderTests.java b/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientBuilderTests.java index 3e26ead380500..888061f19ce26 100644 --- a/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientBuilderTests.java +++ b/sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientBuilderTests.java @@ -245,6 +245,7 @@ public void buildWithHttpProxyFromEnvConfiguration() { Configuration configuration = new ConfigurationBuilder(EMPTY_SOURCE, EMPTY_SOURCE, new TestConfigurationSource() .put(Configuration.PROPERTY_HTTP_PROXY, "http://" + PROXY_USER_INFO + "localhost:" + PROXY_SERVER_HTTP_PORT) .put(Configuration.PROPERTY_HTTPS_PROXY, "") + .put(Configuration.PROPERTY_NO_PROXY, "") .put("java.net.useSystemProxies", "true")).build(); HttpClient httpClient = new VertxHttpClientBuilder().configuration(configuration).build();