Only try to load conscrypt class in tests when supported.
Motivation: 1419f5b601ec7f50938a5e745ec2312f881a580f 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 in c4832cd9d989788f32dc1321d3e4c72bffa3587a 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;
|
package io.netty.handler.ssl;
|
||||||
|
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
import org.conscrypt.OpenSSLProvider;
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLException;
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Parameterized;
|
import org.junit.runners.Parameterized;
|
||||||
|
|
||||||
@ -64,7 +61,7 @@ public class ConscryptJdkSslEngineInteropTest extends SSLEngineTest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Provider clientSslContextProvider() {
|
protected Provider clientSslContextProvider() {
|
||||||
return new OpenSSLProvider();
|
return Java8SslUtils.conscryptProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore /* Does the JDK support a "max certificate chain length"? */
|
@Ignore /* Does the JDK support a "max certificate chain length"? */
|
||||||
|
@ -16,9 +16,12 @@
|
|||||||
|
|
||||||
package io.netty.handler.ssl;
|
package io.netty.handler.ssl;
|
||||||
|
|
||||||
|
import org.conscrypt.OpenSSLProvider;
|
||||||
|
|
||||||
import javax.net.ssl.SNIMatcher;
|
import javax.net.ssl.SNIMatcher;
|
||||||
import javax.net.ssl.SNIServerName;
|
import javax.net.ssl.SNIServerName;
|
||||||
import javax.net.ssl.SSLParameters;
|
import javax.net.ssl.SSLParameters;
|
||||||
|
import java.security.Provider;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
final class Java8SslUtils {
|
final class Java8SslUtils {
|
||||||
@ -34,4 +37,8 @@ final class Java8SslUtils {
|
|||||||
};
|
};
|
||||||
parameters.setSNIMatchers(Collections.singleton(matcher));
|
parameters.setSNIMatchers(Collections.singleton(matcher));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Provider conscryptProvider() {
|
||||||
|
return new OpenSSLProvider();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
package io.netty.handler.ssl;
|
package io.netty.handler.ssl;
|
||||||
|
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
import org.conscrypt.OpenSSLProvider;
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -62,7 +61,7 @@ public class JdkConscryptSslEngineInteropTest extends SSLEngineTest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Provider serverSslContextProvider() {
|
protected Provider serverSslContextProvider() {
|
||||||
return new OpenSSLProvider();
|
return Java8SslUtils.conscryptProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user