Skip to content

Commit

Permalink
Merge pull request #1353 from kstekovi/UNDERTOW-2112_2.2.x
Browse files Browse the repository at this point in the history
UNDERTOW-2112 Client Cert Renegotiation is not supported by JDK14 and newer.
  • Loading branch information
fl4via committed Aug 11, 2022
2 parents 5177c78 + c9b4c24 commit 9a06b56
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -34,6 +34,7 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -67,6 +68,8 @@ protected List<AuthenticationMechanism> getTestMechanisms() {

@BeforeClass
public static void startSSL() throws Exception {
Assume.assumeTrue("UNDERTOW-2112 New version TLSv1.3 and JDK14 and newer versions are breaking this feature",
getJavaSpecificationVersion() < 14);
DefaultServer.startSSLServer(OptionMap.create(SSL_CLIENT_AUTH_MODE, NOT_REQUESTED));
clientSSLContext = DefaultServer.getClientSSLContext();
}
Expand Down Expand Up @@ -149,4 +152,10 @@ public void testClientCertSuccessWithLargePostBody() throws Exception {
HttpClientUtils.readResponse(result);
assertSingleNotificationType(EventType.AUTHENTICATED);
}

private static int getJavaSpecificationVersion() {
String versionString = System.getProperty("java.specification.version");
versionString = versionString.startsWith("1.") ? versionString.substring(2) : versionString;
return Integer.parseInt(versionString);
}
}

0 comments on commit 9a06b56

Please sign in to comment.