|
@@ -30,6 +30,7 @@ import org.junit.BeforeClass;
|
|
|
|
|
|
import javax.net.ssl.KeyManagerFactory;
|
|
|
import javax.net.ssl.SSLContext;
|
|
|
+import javax.net.ssl.SSLHandshakeException;
|
|
|
import javax.net.ssl.TrustManagerFactory;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
@@ -37,7 +38,7 @@ import java.net.InetAddress;
|
|
|
import java.net.InetSocketAddress;
|
|
|
import java.security.KeyStore;
|
|
|
|
|
|
-import static org.hamcrest.Matchers.containsString;
|
|
|
+import static org.hamcrest.Matchers.instanceOf;
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertThat;
|
|
|
import static org.junit.Assert.fail;
|
|
@@ -72,9 +73,6 @@ public class RestClientBuilderIntegTests extends RestClientTestCase {
|
|
|
}
|
|
|
|
|
|
public void testBuilderUsesDefaultSSLContext() throws Exception {
|
|
|
- assumeFalse("Due to bug inside jdk, this test can't momentarily run with java 11. " +
|
|
|
- "See: https://github.com/elastic/elasticsearch/issues/31940",
|
|
|
- System.getProperty("java.version").contains("11"));
|
|
|
final SSLContext defaultSSLContext = SSLContext.getDefault();
|
|
|
try {
|
|
|
try (RestClient client = buildRestClient()) {
|
|
@@ -82,7 +80,7 @@ public class RestClientBuilderIntegTests extends RestClientTestCase {
|
|
|
client.performRequest(new Request("GET", "/"));
|
|
|
fail("connection should have been rejected due to SSL handshake");
|
|
|
} catch (Exception e) {
|
|
|
- assertThat(e.getMessage(), containsString("General SSLEngine problem"));
|
|
|
+ assertThat(e, instanceOf(SSLHandshakeException.class));
|
|
|
}
|
|
|
}
|
|
|
|