use of org.infinispan.rest.helper.RestServerHelper.STORE_TYPE in project infinispan by infinispan.
the class CertificateTest method shouldAllowProperCertificate.
@Test
public void shouldAllowProperCertificate() throws Exception {
restServer = RestServerHelper.defaultRestServer().withAuthenticator(new ClientCertAuthenticator()).withKeyStore(SERVER_KEY_STORE, STORE_PASSWORD, STORE_TYPE).withTrustStore(SERVER_KEY_STORE, STORE_PASSWORD, STORE_TYPE).withClientAuth().start(TestResourceTracker.getCurrentTestShortName());
RestClientConfigurationBuilder config = new RestClientConfigurationBuilder();
config.security().ssl().enable().trustStoreFileName(CLIENT_KEY_STORE).trustStorePassword(STORE_PASSWORD).trustStoreType(STORE_TYPE).keyStoreFileName(CLIENT_KEY_STORE).keyStorePassword(STORE_PASSWORD).keyStoreType(STORE_TYPE).hostnameVerifier((hostname, session) -> true).addServer().host("localhost").port(restServer.getPort());
client = RestClient.forConfiguration(config.build());
// when
CompletionStage<RestResponse> response = client.raw().get("/rest/v2/caches/default/test", Collections.emptyMap());
// then
assertEquals(404, response.toCompletableFuture().get(10, TimeUnit.MINUTES).getStatus());
}
Aggregations