First of all i am sorry if my question is not valid because i don't have any idea on the SSL implementation and validating the request from a trusted certificate authority.
Basically we are using .jks file to validate the request and we are using JAX-RS deployed on wildfly.
In the standalone.xml we have done the configuration like this:
<management>
<security-realms>
**<security-realm name="SslRealm">
<server-identities>
<ssl>
<keystore path="../../../ssl/keystore.jks" relative-to="jboss.server.config.dir" keystore-password="changeme"/>
</ssl>
</server-identities>
</security-realm>**
</security-realms>
Now in the java code we need to read the .jks file , username and password:
public static Response getArtifactsHttps(String authInfo, String area) {
String username = "username";
String password1 = "password";
StringBuilder authorization = new StringBuilder();
authorization.append(username).append(":").append(password1);
// String authHeader = "Basic " + Base64.getEncoder().encodeToString(authorization.toString().getBytes());
Response response = RestAssured
.given()
.keyStore("pathOffile\\DemoTrust.jks", "DemoTrustKeyStorePassPhrase")
.when()
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.header(Constant.HTTP_HEADERS.AUTHORIZATION, "Basic " + authInfo)
.header(Constant.HTTP_HEADERS.MODULETYPE, Constant.AC_MODULETYPE.CLIENT)
.get("login").thenReturn();
System.out.println("RESPONSE" + response);
return response;
}
In the above you can see i have hardcoded the path of the .jks file pathoffile\DemoTrust.jks also username and password i have hardcoded.
Now i want to read all these value from the standalone.xml file. Can anybody suggest me how i can do this using java?