I have problem with keystoreRelativeTo option in ManagementFraction of Wildfly swarm app.
Here is the code:
public static void main(String[] args) throws Exception {
Swarm swarm = new Swarm(args);
Archive<JAXRSArchive> archive = createJaxRsArchive();
swarm
.fraction(createManagementFraction())
.fraction(createUndertowFraction())
.fraction(createSecurityFraction())
.start()
.deploy(archive);
}
ManagementFraction managementFraction = new ManagementFraction().securityRealm("UndertowRealm", (realm) -> {
realm.truststoreAuthentication((authn) -> { authn
//.keystoreRelativeTo("/certs")
.keystorePath("sometruststore.jks")
.keystorePassword("pass");
});
realm.sslServerIdentity(new SslServerIdentity<>()
//.keystoreRelativeTo("/certs")
.keystorePath("somekeystore.jks")
.keystorePassword("pass")
.alias("x")
.keyPassword("pass")
);
});
return managementFraction;
}
Without ".keystoreRelativeTo("/certs")" it works fine as long as *.jks files are in projects root dir. With option ".keystoreRelativeTo("/certs")" I would expect so it checks for jks files inside projectRootDir/certs, but it's not. I've tried also with an absolute path for example C:/certs but doesn't work as well. I've got error:
2017-01-03 21:56:26,638 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([ ("subsystem" => "undertow"), ("server" => "default-server"), ("https-listener" => "https") ]) - failure description: { "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined, "WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => { "Services that were unable to start:" => ["jboss.undertow.listener.https"], "Services that may be the cause:" => ["jboss.server.path./certs/"] } }
2017-01-03 21:56:26,639 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([ ("core-service" => "management"), ("security-realm" => "UndertowRealm") ]) - failure description: { "WFLYCTL0412: Required services that are not installed:" => ["jboss.server.path./certs/"], "WFLYCTL0180: Services with missing/unavailable dependencies" => [ "jboss.server.controller.management.security_realm.UndertowRealm.trust-manager is missing [jboss.server.path./certs/]", "jboss.server.controller.management.security_realm.UndertowRealm.key-manager is missing [jboss.server.path./certs/]" ] }
I dont know what "jboss.server.path" is, I thought it is some jboss properties but can't find nor set it. I've tried also with jboss.server.config.dir parameter (setting it before to /certs/ or C:/certs/): .keystoreRelativeTo("jboss.server.config.dir")
but error message is the same: (...) "Services that were unable to start:" => ["jboss.undertow.listener.https"], "Services that may be the cause:" => ["jboss.server.path.\"jboss.server.config.dir\""] (...)
Is it some bug? Any help would be appreciated.