Hardcode TLS version used during blockhound tests (#10162)
Motivation: Different versions of the JDK use different TLS versions by default. We should define the versions explicit Modifications: Explicit specify TLSv1.2 Result: Blockhound tests pass on JDK14 as well
This commit is contained in:
parent
0368da9e3c
commit
760de7dde4
@ -55,7 +55,6 @@ import java.util.concurrent.Executors;
|
|||||||
import java.util.concurrent.FutureTask;
|
import java.util.concurrent.FutureTask;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
@ -121,13 +120,14 @@ public class NettyBlockHoundIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void testHandshakeWithExecutor(Executor executor) throws Exception {
|
private static void testHandshakeWithExecutor(Executor executor) throws Exception {
|
||||||
|
String tlsVersion = "TLSv1.2";
|
||||||
final SslContext sslClientCtx = SslContextBuilder.forClient()
|
final SslContext sslClientCtx = SslContextBuilder.forClient()
|
||||||
.trustManager(InsecureTrustManagerFactory.INSTANCE)
|
.trustManager(InsecureTrustManagerFactory.INSTANCE)
|
||||||
.sslProvider(SslProvider.JDK).build();
|
.sslProvider(SslProvider.JDK).protocols(tlsVersion).build();
|
||||||
|
|
||||||
final SelfSignedCertificate cert = new SelfSignedCertificate();
|
final SelfSignedCertificate cert = new SelfSignedCertificate();
|
||||||
final SslContext sslServerCtx = SslContextBuilder.forServer(cert.key(), cert.cert())
|
final SslContext sslServerCtx = SslContextBuilder.forServer(cert.key(), cert.cert())
|
||||||
.sslProvider(SslProvider.JDK).build();
|
.sslProvider(SslProvider.JDK).protocols(tlsVersion).build();
|
||||||
|
|
||||||
EventLoopGroup group = new NioEventLoopGroup();
|
EventLoopGroup group = new NioEventLoopGroup();
|
||||||
Channel sc = null;
|
Channel sc = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user