Fix app-server addHttpListener failure
This commit is contained in:
parent
4dd58ebde7
commit
30cef7aa68
2 changed files with 21 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue