KEYCLOAK-5720 Fix X.509 tests

This commit is contained in:
vmuzikar 2017-11-03 16:50:59 +01:00
parent 1ac9bd510b
commit ef8adc15f4
3 changed files with 5 additions and 2 deletions

View file

@ -71,6 +71,7 @@ import org.keycloak.testsuite.util.TestEventsLogger;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.wildfly.extras.creaper.commands.undertow.AddUndertowListener; import org.wildfly.extras.creaper.commands.undertow.AddUndertowListener;
import org.wildfly.extras.creaper.commands.undertow.RemoveUndertowListener; 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.commands.undertow.UndertowListenerType;
import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.CommandFailedException;
import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.CliException;
@ -441,6 +442,7 @@ public abstract class AbstractKeycloakTest {
if(!operations.exists(Address.coreService("management").and("security-realm", "UndertowRealm"))) { if(!operations.exists(Address.coreService("management").and("security-realm", "UndertowRealm"))) {
client.execute("/core-service=management/security-realm=UndertowRealm:add()"); client.execute("/core-service=management/security-realm=UndertowRealm:add()");
client.execute("/core-service=management/security-realm=UndertowRealm/server-identity=ssl:add(keystore-relative-to=jboss.server.config.dir,keystore-password=secret,keystore-path=keycloak.jks"); client.execute("/core-service=management/security-realm=UndertowRealm/server-identity=ssl:add(keystore-relative-to=jboss.server.config.dir,keystore-password=secret,keystore-path=keycloak.jks");
client.execute("/core-service=management/security-realm=UndertowRealm/authentication=truststore:add(keystore-relative-to=jboss.server.config.dir,keystore-password=secret,keystore-path=keycloak.truststore");
} }
client.apply(new RemoveUndertowListener.Builder(UndertowListenerType.HTTPS_LISTENER, "https") client.apply(new RemoveUndertowListener.Builder(UndertowListenerType.HTTPS_LISTENER, "https")
@ -450,6 +452,7 @@ public abstract class AbstractKeycloakTest {
client.apply(new AddUndertowListener.HttpsBuilder("https", "default-server", "https") client.apply(new AddUndertowListener.HttpsBuilder("https", "default-server", "https")
.securityRealm("UndertowRealm") .securityRealm("UndertowRealm")
.verifyClient(SslVerifyClient.REQUESTED)
.build()); .build());
administration.reloadIfRequired(); administration.reloadIfRequired();

View file

@ -34,7 +34,7 @@
<property name="htmlUnitWebClientOptions">cssEnabled=false;historyPageCacheLimit=1</property> <property name="htmlUnitWebClientOptions">cssEnabled=false;historyPageCacheLimit=1</property>
<!-- phantomjs --> <!-- phantomjs -->
<property name="phantomjs.cli.args">${phantomjs.cli.args} --ssl-certificates-path=${client.certificate.ca.path} --ssl-client-certificate-file=${client.certificate.file} --ssl-client-key-file=${client.key.file} --ssl-client-key-passphrase=${client.key.passphrase}</property> <property name="phantomjs.cli.args">${phantomjs.cli.args}</property>
<!-- firefox --> <!-- firefox -->
<property name="firefox_binary">${firefox_binary}</property> <property name="firefox_binary">${firefox_binary}</property>

View file

@ -102,7 +102,7 @@
<github.secretToken/> <github.secretToken/>
<ieDriverArch/> <ieDriverArch/>
<htmlUnitBrowserVersion>chrome</htmlUnitBrowserVersion> <htmlUnitBrowserVersion>chrome</htmlUnitBrowserVersion>
<phantomjs.cli.args>--ignore-ssl-errors=true --web-security=false</phantomjs.cli.args> <phantomjs.cli.args>--ignore-ssl-errors=true --web-security=false --ssl-certificates-path=${client.certificate.ca.path} --ssl-client-certificate-file=${client.certificate.file} --ssl-client-key-file=${client.key.file} --ssl-client-key-passphrase=${client.key.passphrase}</phantomjs.cli.args>
<firefox_binary>/usr/bin/firefox</firefox_binary> <firefox_binary>/usr/bin/firefox</firefox_binary>
<firefoxLegacyDriver>true</firefoxLegacyDriver> <firefoxLegacyDriver>true</firefoxLegacyDriver>
<chromeArguments/> <chromeArguments/>