use of org.apache.druid.testing.utils.ITTLSCertificateChecker in project druid by druid-io.
the class ITTLSTest method checkAccessWithCustomCertificateChecks.
@Test
public void checkAccessWithCustomCertificateChecks() {
LOG.info("---------Testing TLS resource access with custom certificate checks---------");
HttpClient wrongHostnameClient = makeCustomHttpClient("client_tls/invalid_hostname_client.jks", "invalid_hostname_client", new ITTLSCertificateChecker());
checkFailedAccessWrongHostname(httpClient, HttpMethod.GET, config.getCustomCertCheckRouterTLSUrl());
makeRequest(wrongHostnameClient, HttpMethod.GET, config.getCustomCertCheckRouterTLSUrl() + "/status", null);
checkFailedAccess(wrongHostnameClient, HttpMethod.POST, config.getCustomCertCheckRouterTLSUrl() + "/druid/v2", "Custom cert check", ISE.class, "Error while making request to url[https://127.0.0.1:9091/druid/v2] status[400 Bad Request] content[{\"error\":\"Unknown exception\",\"errorMessage\":\"No content to map due to end-of-input", true);
makeRequest(wrongHostnameClient, HttpMethod.GET, config.getCustomCertCheckRouterTLSUrl() + "/druid/coordinator/v1/leader", null);
}
Aggregations