mirror of https://github.com/grpc/grpc-java.git
netty: Add support for IBMJSSE2 (#7422)
This is a very simple change to test for IBMJSSE2 security provider in addition to the others. IBM JRE does not support the Sun provider, but instead has IBMJSSE2 which supports the same API calls. I tested this on Z/OS machine as now it works when before it couldn't find a security provider
This commit is contained in:
parent
ee5b5929d5
commit
5879b53c57
|
|
@ -82,6 +82,7 @@ public class GrpcSslContexts {
|
|||
NEXT_PROTOCOL_VERSIONS);
|
||||
|
||||
private static final String SUN_PROVIDER_NAME = "SunJSSE";
|
||||
private static final String IBM_PROVIDER_NAME = "IBMJSSE2";
|
||||
|
||||
/**
|
||||
* Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
|
||||
|
|
@ -196,7 +197,14 @@ public class GrpcSslContexts {
|
|||
apc = ALPN;
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
SUN_PROVIDER_NAME + " selected, but Java 9+ and Jetty NPN/ALPN unavailable");
|
||||
jdkProvider.getName() + " selected, but Java 9+ and Jetty NPN/ALPN unavailable");
|
||||
}
|
||||
} else if (IBM_PROVIDER_NAME.equals(jdkProvider.getName())) {
|
||||
if (JettyTlsUtil.isJava9AlpnAvailable()) {
|
||||
apc = ALPN;
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
jdkProvider.getName() + " selected, but Java 9+ ALPN unavailable");
|
||||
}
|
||||
} else if (ConscryptLoader.isConscrypt(jdkProvider)) {
|
||||
apc = ALPN;
|
||||
|
|
@ -243,6 +251,10 @@ public class GrpcSslContexts {
|
|||
|| JettyTlsUtil.isJava9AlpnAvailable()) {
|
||||
return provider;
|
||||
}
|
||||
} else if (IBM_PROVIDER_NAME.equals(provider.getName())) {
|
||||
if (JettyTlsUtil.isJava9AlpnAvailable()) {
|
||||
return provider;
|
||||
}
|
||||
} else if (ConscryptLoader.isConscrypt(provider)) {
|
||||
return provider;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue