Skip to content

Commit 214652d

Browse files
authored
[TESTS] Pin MockWebServer to TLS1.2 (elastic#33127)
Ensure that the SSLConfigurationReloaderTests can run with JDK 11 by pinning the Server TLS version to TLS1.2. This can be revisited while tackling the effort to full support TLSv1.3 in elastic#32276 Resolves elastic#32124
1 parent 47859e5 commit 214652d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/SSLConfigurationReloaderTests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public void cleanup() throws Exception {
7878
/**
7979
* Tests reloading a keystore that is used in the KeyManager of SSLContext
8080
*/
81-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32124")
8281
public void testReloadingKeyStore() throws Exception {
8382
assumeFalse("Can't run in a FIPS JVM", inFipsJvm());
8483
final Path tempDir = createTempDir();
@@ -192,7 +191,6 @@ public void testPEMKeyConfigReloading() throws Exception {
192191
* Tests the reloading of SSLContext when the trust store is modified. The same store is used as a TrustStore (for the
193192
* reloadable SSLContext used in the HTTPClient) and as a KeyStore for the MockWebServer
194193
*/
195-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32124")
196194
public void testReloadingTrustStore() throws Exception {
197195
assumeFalse("Can't run in a FIPS JVM", inFipsJvm());
198196
Path tempDir = createTempDir();
@@ -479,7 +477,9 @@ private static MockWebServer getSslServer(Path keyStorePath, String keyStorePass
479477
try (InputStream is = Files.newInputStream(keyStorePath)) {
480478
keyStore.load(is, keyStorePass.toCharArray());
481479
}
482-
final SSLContext sslContext = new SSLContextBuilder().loadKeyMaterial(keyStore, keyStorePass.toCharArray())
480+
// TODO Revisit TLS1.2 pinning when TLS1.3 is fully supported
481+
// https://github.com/elastic/elasticsearch/issues/32276
482+
final SSLContext sslContext = new SSLContextBuilder().useProtocol("TLSv1.2").loadKeyMaterial(keyStore, keyStorePass.toCharArray())
483483
.build();
484484
MockWebServer server = new MockWebServer(sslContext, false);
485485
server.enqueue(new MockResponse().setResponseCode(200).setBody("body"));
@@ -493,7 +493,9 @@ private static MockWebServer getSslServer(Path keyPath, Path certPath, String pa
493493
keyStore.load(null, password.toCharArray());
494494
keyStore.setKeyEntry("testnode_ec", PemUtils.readPrivateKey(keyPath, password::toCharArray), password.toCharArray(),
495495
CertParsingUtils.readCertificates(Collections.singletonList(certPath)));
496-
final SSLContext sslContext = new SSLContextBuilder().loadKeyMaterial(keyStore, password.toCharArray())
496+
// TODO Revisit TLS1.2 pinning when TLS1.3 is fully supported
497+
// https://github.com/elastic/elasticsearch/issues/32276
498+
final SSLContext sslContext = new SSLContextBuilder().useProtocol("TLSv1.2").loadKeyMaterial(keyStore, password.toCharArray())
497499
.build();
498500
MockWebServer server = new MockWebServer(sslContext, false);
499501
server.enqueue(new MockResponse().setResponseCode(200).setBody("body"));

0 commit comments

Comments
 (0)