mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Pin TLS1.2 in SSLConfigurationReloaderTests
Ensure that the SSLConfigurationReloaderTests can run with JDK 11 by pinning the HttpClient to TLS version to TLS1.2. This is necessary becase even if the MockWebServer is set to user TLS1.2, we don't set its enabled protocols, so if it receives a TLS1.3 request (which is the default behavior for HttpClient in JDK11), it will use TLS1.3 and the original issue will manifest again. Relates #33127 Resolves #32124
This commit is contained in:
parent
39191331d1
commit
d9f5e4fd2e
@ -510,7 +510,7 @@ public class SSLConfigurationReloaderTests extends ESTestCase {
|
||||
try (InputStream is = Files.newInputStream(trustStorePath)) {
|
||||
trustStore.load(is, trustStorePass.toCharArray());
|
||||
}
|
||||
final SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(trustStore, null).build();
|
||||
final SSLContext sslContext = new SSLContextBuilder().useProtocol("TLSv1.2").loadTrustMaterial(trustStore, null).build();
|
||||
return HttpClients.custom().setSSLContext(sslContext).build();
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ public class SSLConfigurationReloaderTests extends ESTestCase {
|
||||
for (Certificate cert : CertParsingUtils.readCertificates(trustedCertificatePaths)) {
|
||||
trustStore.setCertificateEntry(cert.toString(), cert);
|
||||
}
|
||||
final SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(trustStore, null).build();
|
||||
final SSLContext sslContext = new SSLContextBuilder().useProtocol("TLSv1.2").loadTrustMaterial(trustStore, null).build();
|
||||
return HttpClients.custom().setSSLContext(sslContext).build();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user