From bf1f2edb565dd8b31078c55279a7b1544afda71c Mon Sep 17 00:00:00 2001 From: Pablo Carle Date: Mon, 4 Nov 2024 15:27:08 +0100 Subject: [PATCH] use default jdk dns resolver (#3877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pablo Hernán Carle Co-authored-by: Pablo Hernán Carle --- .../apiml/gateway/config/ConnectionsConfig.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gateway-service/src/main/java/org/zowe/apiml/gateway/config/ConnectionsConfig.java b/gateway-service/src/main/java/org/zowe/apiml/gateway/config/ConnectionsConfig.java index 7a541e848a..1013dc5879 100644 --- a/gateway-service/src/main/java/org/zowe/apiml/gateway/config/ConnectionsConfig.java +++ b/gateway-service/src/main/java/org/zowe/apiml/gateway/config/ConnectionsConfig.java @@ -20,6 +20,7 @@ import io.github.resilience4j.timelimiter.TimeLimiterConfig; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; +import io.netty.resolver.DefaultAddressResolverGroup; import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; import org.springframework.aop.support.AopUtils; @@ -345,7 +346,9 @@ public HttpClientFactory gatewayHttpClientFactory( return new HttpClientFactory(properties, serverProperties, sslConfigurer, customizers) { @Override protected HttpClient createInstance() { - return super.createInstance().secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)); + return super.createInstance() + .secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)) + .resolver(DefaultAddressResolverGroup.INSTANCE); } }; } @@ -353,12 +356,16 @@ protected HttpClient createInstance() { @Bean @Primary public WebClient webClient(HttpClient httpClient) { - return WebClient.builder().clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, false))).build(); + return WebClient.builder() + .clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, false))) + .build(); } @Bean public WebClient webClientClientCert(HttpClient httpClient) { - return WebClient.builder().clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, true))).build(); + return WebClient.builder() + .clientConnector(new ReactorClientHttpConnector(getHttpClient(httpClient, true))) + .build(); } @Bean