|
30 | 30 |
|
31 | 31 | import javax.net.ssl.KeyManagerFactory; |
32 | 32 | import javax.net.ssl.SSLContext; |
| 33 | +import javax.net.ssl.SSLHandshakeException; |
33 | 34 | import javax.net.ssl.TrustManagerFactory; |
34 | 35 | import java.io.IOException; |
35 | 36 | import java.io.InputStream; |
36 | 37 | import java.net.InetAddress; |
37 | 38 | import java.net.InetSocketAddress; |
38 | 39 | import java.security.KeyStore; |
39 | 40 |
|
40 | | -import static org.hamcrest.Matchers.containsString; |
| 41 | +import static org.hamcrest.Matchers.instanceOf; |
41 | 42 | import static org.junit.Assert.assertEquals; |
42 | 43 | import static org.junit.Assert.assertThat; |
43 | 44 | import static org.junit.Assert.fail; |
@@ -72,17 +73,14 @@ public static void stopHttpServers() throws IOException { |
72 | 73 | } |
73 | 74 |
|
74 | 75 | public void testBuilderUsesDefaultSSLContext() throws Exception { |
75 | | - assumeFalse("Due to bug inside jdk, this test can't momentarily run with java 11. " + |
76 | | - "See: https://github.com/elastic/elasticsearch/issues/31940", |
77 | | - System.getProperty("java.version").contains("11")); |
78 | 76 | final SSLContext defaultSSLContext = SSLContext.getDefault(); |
79 | 77 | try { |
80 | 78 | try (RestClient client = buildRestClient()) { |
81 | 79 | try { |
82 | 80 | client.performRequest(new Request("GET", "/")); |
83 | 81 | fail("connection should have been rejected due to SSL handshake"); |
84 | 82 | } catch (Exception e) { |
85 | | - assertThat(e.getMessage(), containsString("General SSLEngine problem")); |
| 83 | + assertThat(e, instanceOf(SSLHandshakeException.class)); |
86 | 84 | } |
87 | 85 | } |
88 | 86 |
|
|
0 commit comments