From e85e6e56df969fedf51ad1de9cd45d7c3da44289 Mon Sep 17 00:00:00 2001 From: Lin Gao Date: Thu, 28 Nov 2024 15:46:23 +0800 Subject: [PATCH] [Issue-42] Use the default (blocking) AddressResolverProvider --- .../base/org/wildfly/extension/vertx/main/module.xml | 1 + .../org/wildfly/extension/vertx/VertxProxyService.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/galleon-feature-pack/galleon-content/src/main/resources/modules/system/layers/base/org/wildfly/extension/vertx/main/module.xml b/galleon-feature-pack/galleon-content/src/main/resources/modules/system/layers/base/org/wildfly/extension/vertx/main/module.xml index 7d1b435..36dbd76 100644 --- a/galleon-feature-pack/galleon-content/src/main/resources/modules/system/layers/base/org/wildfly/extension/vertx/main/module.xml +++ b/galleon-feature-pack/galleon-content/src/main/resources/modules/system/layers/base/org/wildfly/extension/vertx/main/module.xml @@ -22,6 +22,7 @@ + diff --git a/subsystem/src/main/java/org/wildfly/extension/vertx/VertxProxyService.java b/subsystem/src/main/java/org/wildfly/extension/vertx/VertxProxyService.java index 67a76d4..7e0d644 100644 --- a/subsystem/src/main/java/org/wildfly/extension/vertx/VertxProxyService.java +++ b/subsystem/src/main/java/org/wildfly/extension/vertx/VertxProxyService.java @@ -7,6 +7,7 @@ import io.vertx.core.Vertx; import io.vertx.core.VertxOptions; import io.vertx.core.impl.VertxBuilder; +import io.vertx.core.spi.resolver.ResolverProvider; import org.jboss.as.controller.CapabilityServiceBuilder; import org.jboss.as.controller.OperationContext; import org.jboss.msc.Service; @@ -15,6 +16,7 @@ import org.jboss.msc.service.StartException; import org.jboss.msc.service.StopContext; import org.wildfly.extension.vertx.logging.VertxLogger; +import org.wildfly.security.manager.WildFlySecurityManager; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; @@ -29,6 +31,12 @@ * @author Lin Gao */ public class VertxProxyService implements Service, VertxConstants { + + static { + if (WildFlySecurityManager.getPropertyPrivileged(ResolverProvider.DISABLE_DNS_RESOLVER_PROP_NAME, null) == null) { + WildFlySecurityManager.setPropertyPrivileged(ResolverProvider.DISABLE_DNS_RESOLVER_PROP_NAME, "true"); + } + } private VertxProxy vertxProxy; private final String optionName; private final Supplier optionsSupplier;