diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java index d7b2bb2504..8c735e2309 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java @@ -58,7 +58,7 @@ import java.util.Set; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; -import static org.keycloak.testsuite.arquillian.ServerTestEnricherUtil.addHttpsListener; +import static org.keycloak.testsuite.arquillian.ServerTestEnricherUtil.addHttpsListenerAppServer; import static org.keycloak.testsuite.arquillian.ServerTestEnricherUtil.reloadOrRestartTimeoutClient; import static org.keycloak.testsuite.arquillian.ServerTestEnricherUtil.removeHttpsListener; import static org.keycloak.testsuite.util.ServerURLs.getAppServerContextRoot; @@ -250,7 +250,7 @@ public class AppServerTestEnricher { } } else { removeHttpsListener(client, administration); - addHttpsListener(client); + addHttpsListenerAppServer(client); } reloadOrRestartTimeoutClient(administration); diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ServerTestEnricherUtil.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ServerTestEnricherUtil.java index e0d24cac5c..2cb1eceaa9 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ServerTestEnricherUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ServerTestEnricherUtil.java @@ -18,7 +18,9 @@ package org.keycloak.testsuite.arquillian; import org.jboss.logging.Logger; +import org.wildfly.extras.creaper.commands.undertow.AddUndertowListener; import org.wildfly.extras.creaper.commands.undertow.RemoveUndertowListener; +import org.wildfly.extras.creaper.commands.undertow.SslVerifyClient; import org.wildfly.extras.creaper.commands.undertow.UndertowListenerType; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -60,6 +62,23 @@ public class ServerTestEnricherUtil { } } + /** + * Add Undertow HTTPS listener for Wildfly 23 + */ + public static boolean addHttpsListenerAppServer(OnlineManagementClient client) { + try { + LOG.debug("Add Undertow HTTPS listener 'https'"); + client.apply(new AddUndertowListener.HttpsBuilder("https", "default-server", "https") + .securityRealm("UndertowRealm") + .verifyClient(SslVerifyClient.REQUESTED) + .build()); + return true; + } catch (CommandFailedException e) { + LOG.warn("Cannot add HTTPS listener 'https'"); + return false; + } + } + /** * Restart client after timeout for reloading */