Search in sources :

Example 1 with ITTLSCertificateChecker

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);
}
Also used : HttpClient(org.apache.druid.java.util.http.client.HttpClient) CredentialedHttpClient(org.apache.druid.java.util.http.client.CredentialedHttpClient) ITTLSCertificateChecker(org.apache.druid.testing.utils.ITTLSCertificateChecker) Test(org.testng.annotations.Test)

Aggregations

CredentialedHttpClient (org.apache.druid.java.util.http.client.CredentialedHttpClient)1 HttpClient (org.apache.druid.java.util.http.client.HttpClient)1 ITTLSCertificateChecker (org.apache.druid.testing.utils.ITTLSCertificateChecker)1 Test (org.testng.annotations.Test)1