|
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;
|
|
43 | 44 | import java.security.cert.CertificateFactory;
|
44 | 45 | import java.security.spec.PKCS8EncodedKeySpec;
|
45 | 46 |
|
46 |
| -import static org.hamcrest.Matchers.containsString; |
| 47 | +import static org.hamcrest.Matchers.instanceOf; |
47 | 48 | import static org.junit.Assert.assertEquals;
|
48 | 49 | import static org.junit.Assert.assertThat;
|
49 | 50 | import static org.junit.Assert.fail;
|
@@ -78,17 +79,14 @@ public static void stopHttpServers() throws IOException {
|
78 | 79 | }
|
79 | 80 |
|
80 | 81 | public void testBuilderUsesDefaultSSLContext() throws Exception {
|
81 |
| - assumeFalse("Due to bug inside jdk, this test can't momentarily run with java 11. " + |
82 |
| - "See: https://github.com/elastic/elasticsearch/issues/31940", |
83 |
| - System.getProperty("java.version").contains("11")); |
84 | 82 | final SSLContext defaultSSLContext = SSLContext.getDefault();
|
85 | 83 | try {
|
86 | 84 | try (RestClient client = buildRestClient()) {
|
87 | 85 | try {
|
88 | 86 | client.performRequest(new Request("GET", "/"));
|
89 | 87 | fail("connection should have been rejected due to SSL handshake");
|
90 | 88 | } catch (Exception e) {
|
91 |
| - assertThat(e.getMessage(), containsString("General SSLEngine problem")); |
| 89 | + assertThat(e, instanceOf(SSLHandshakeException.class)); |
92 | 90 | }
|
93 | 91 | }
|
94 | 92 |
|
|
0 commit comments