Only try to load conscrypt class in tests when supported.
Motivation:1419f5b601
added support for conscrypt but the CI started to fail when running tests with java7 as conscrypt is compiled with java8. This was partly fixed inc4832cd9d9
but we also need to ensure we not try to even load the classes. Modifications: Only try to load conscrypt classes when on java8+- Result: CI not fails anymore.
This commit is contained in:
parent
c4832cd9d9
commit
5163869439
@ -16,12 +16,9 @@
|
||||
package io.netty.handler.ssl;
|
||||
|
||||
import java.security.Provider;
|
||||
import org.conscrypt.OpenSSLProvider;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.net.ssl.SSLException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
@ -64,7 +61,7 @@ public class ConscryptJdkSslEngineInteropTest extends SSLEngineTest {
|
||||
|
||||
@Override
|
||||
protected Provider clientSslContextProvider() {
|
||||
return new OpenSSLProvider();
|
||||
return Java8SslUtils.conscryptProvider();
|
||||
}
|
||||
|
||||
@Ignore /* Does the JDK support a "max certificate chain length"? */
|
||||
|
@ -16,9 +16,12 @@
|
||||
|
||||
package io.netty.handler.ssl;
|
||||
|
||||
import org.conscrypt.OpenSSLProvider;
|
||||
|
||||
import javax.net.ssl.SNIMatcher;
|
||||
import javax.net.ssl.SNIServerName;
|
||||
import javax.net.ssl.SSLParameters;
|
||||
import java.security.Provider;
|
||||
import java.util.Collections;
|
||||
|
||||
final class Java8SslUtils {
|
||||
@ -34,4 +37,8 @@ final class Java8SslUtils {
|
||||
};
|
||||
parameters.setSNIMatchers(Collections.singleton(matcher));
|
||||
}
|
||||
|
||||
static Provider conscryptProvider() {
|
||||
return new OpenSSLProvider();
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
package io.netty.handler.ssl;
|
||||
|
||||
import java.security.Provider;
|
||||
import org.conscrypt.OpenSSLProvider;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@ -62,7 +61,7 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest {
|
||||
|
||||
@Override
|
||||
protected Provider serverSslContextProvider() {
|
||||
return new OpenSSLProvider();
|
||||
return Java8SslUtils.conscryptProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user