Skip to content

Commit f8f4592

Browse files
committed
Workaround JDK-8213202 in SSLClientAuthTests
This change works around JDK-8213202, which is a bug related to TLSv1.3 session resumption before JDK 11.0.3 that occurs when there are multiple concurrent sessions being established. Nodes connecting to each other will trigger this bug when client authentication is disabled, which is the case for SSLClientAuthTests. Closes elastic#46230
1 parent 6f1359f commit f8f4592

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/ssl/SSLClientAuthTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ protected Settings nodeSettings(int nodeOrdinal) {
8888
return builder
8989
// invert the require auth settings
9090
.put("xpack.security.transport.ssl.client_authentication", SSLClientAuth.NONE)
91+
// Due to the TLSv1.3 bug with session resumption when client authentication is not
92+
// used, we need to set the protocols since we disabled client auth for transport
93+
// to avoid failures on pre 11.0.3 JDKs. See #getProtocols
94+
.putList("xpack.security.transport.ssl.supported_protocols", getProtocols())
9195
.put("xpack.security.http.ssl.enabled", true)
9296
.put("xpack.security.http.ssl.client_authentication", SSLClientAuth.REQUIRED)
9397
.build();
@@ -98,7 +102,6 @@ protected boolean transportSSLEnabled() {
98102
return true;
99103
}
100104

101-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/46230")
102105
public void testThatHttpFailsWithoutSslClientAuth() throws IOException {
103106
SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(SSLContexts.createDefault(), NoopHostnameVerifier.INSTANCE);
104107
try (RestClient restClient = createRestClient(httpClientBuilder -> httpClientBuilder.setSSLStrategy(sessionStrategy), "https")) {
@@ -115,7 +118,6 @@ public void testThatHttpFailsWithoutSslClientAuth() throws IOException {
115118
}
116119
}
117120

118-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/46230")
119121
public void testThatHttpWorksWithSslClientAuth() throws IOException {
120122
SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(getSSLContext(), NoopHostnameVerifier.INSTANCE);
121123
try (RestClient restClient = createRestClient(httpClientBuilder -> httpClientBuilder.setSSLStrategy(sessionStrategy), "https")) {

0 commit comments

Comments
 (0)