From 7f20adb5fc84ed77c00fc52e7891e94544571eb6 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 14 Dec 2018 21:33:38 +0100 Subject: [PATCH] Skip tests that use KeyManagerFactory if not supported by OpenSSL version / flavor (#8662) Motivation: We missed to skip a few tests that depend on the KeyManagerFactory if the used OpenSSL version / flavor not support it. Modifications: Add missing overrides. Result: Testsuite also passes for example when using LibreSSL. --- .../handler/ssl/JdkOpenSslEngineInteroptTest.java | 14 ++++++++++++++ .../ssl/OpenSslJdkSslEngineInteroptTest.java | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java b/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java index a85b665ff2..45b3c7e5e0 100644 --- a/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/JdkOpenSslEngineInteroptTest.java @@ -100,6 +100,20 @@ public class JdkOpenSslEngineInteroptTest extends SSLEngineTest { super.testMutualAuthValidClientCertChainTooLongFailRequireClientAuth(); } + @Override + @Test + public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth() throws Exception { + checkShouldUseKeyManagerFactory(); + super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(); + } + + @Override + @Test + public void testSessionAfterHandshakeKeyManagerFactory() throws Exception { + checkShouldUseKeyManagerFactory(); + super.testSessionAfterHandshakeKeyManagerFactory(); + } + @Override protected void mySetupMutualAuthServerInitSslHandler(SslHandler handler) { ReferenceCountedOpenSslEngine engine = (ReferenceCountedOpenSslEngine) handler.engine(); diff --git a/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java b/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java index bc1106e7a3..df4e757e50 100644 --- a/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/OpenSslJdkSslEngineInteroptTest.java @@ -112,6 +112,13 @@ public class OpenSslJdkSslEngineInteroptTest extends SSLEngineTest { super.testClientHostnameValidationFail(); } + @Override + @Test + public void testSessionAfterHandshakeKeyManagerFactoryMutualAuth() throws Exception { + checkShouldUseKeyManagerFactory(); + super.testSessionAfterHandshakeKeyManagerFactoryMutualAuth(); + } + @Override protected boolean mySetupMutualAuthServerIsValidServerException(Throwable cause) { // TODO(scott): work around for a JDK issue. The exception should be SSLHandshakeException.