Search in sources :

Example 1 with ServerIdentity

use of org.jboss.as.test.integration.security.common.config.realm.ServerIdentity in project wildfly by wildfly.

the class WebCERTTestsSecurityDomainSetup method getSecurityRealms.

@Override
protected SecurityRealm[] getSecurityRealms() throws Exception {
    URL keystoreResource = Thread.currentThread().getContextClassLoader().getResource("security/server.keystore");
    URL truststoreResource = Thread.currentThread().getContextClassLoader().getResource("security/jsse.keystore");
    RealmKeystore keystore = new RealmKeystore.Builder().keystorePassword("changeit").keystorePath(keystoreResource.getPath()).build();
    RealmKeystore truststore = new RealmKeystore.Builder().keystorePassword("changeit").keystorePath(truststoreResource.getPath()).build();
    return new SecurityRealm[] { new SecurityRealm.Builder().name("ssl-cert-realm").serverIdentity(new ServerIdentity.Builder().ssl(keystore).build()).authentication(new Authentication.Builder().truststore(truststore).build()).build() };
}
Also used : ServerIdentity(org.jboss.as.test.integration.security.common.config.realm.ServerIdentity) RealmKeystore(org.jboss.as.test.integration.security.common.config.realm.RealmKeystore) SecurityRealm(org.jboss.as.test.integration.security.common.config.realm.SecurityRealm) OperationBuilder(org.jboss.as.controller.client.OperationBuilder) URL(java.net.URL) URL(org.jboss.as.security.Constants.URL)

Aggregations

URL (java.net.URL)1 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)1 URL (org.jboss.as.security.Constants.URL)1 RealmKeystore (org.jboss.as.test.integration.security.common.config.realm.RealmKeystore)1 SecurityRealm (org.jboss.as.test.integration.security.common.config.realm.SecurityRealm)1 ServerIdentity (org.jboss.as.test.integration.security.common.config.realm.ServerIdentity)1