diff --git a/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java b/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java index f82703006d0..0c885840a17 100644 --- a/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java +++ b/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java @@ -68,7 +68,7 @@ public class SSLClientAuthTests extends SecurityIntegTestCase { try (RestClient restClient = createRestClient(httpClientBuilder -> httpClientBuilder.setSSLStrategy(sessionStrategy), "https")) { restClient.performRequest("GET", "/"); fail("Expected SSLHandshakeException"); - } catch (SSLHandshakeException e) { + } catch (IOException e) { Throwable t = ExceptionsHelper.unwrap(e, CertPathBuilderException.class); assertThat(t, instanceOf(CertPathBuilderException.class)); assertThat(t.getMessage(), containsString("unable to find valid certification path to requested target"));