Package io.grpc.netty
Class GrpcSslContexts
- java.lang.Object
-
- io.grpc.netty.GrpcSslContexts
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1784") public class GrpcSslContexts extends java.lang.Object
Utility for configuring SslContext for gRPC.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classGrpcSslContexts.ConscryptHolder
-
Field Summary
Fields Modifier and Type Field Description private static io.netty.handler.ssl.ApplicationProtocolConfigALPNprivate static java.lang.StringHTTP2_VERSIONprivate static java.lang.StringIBM_PROVIDER_NAMEprivate static java.util.logging.Loggerloggerprivate static java.util.List<java.lang.String>NEXT_PROTOCOL_VERSIONSprivate static io.netty.handler.ssl.ApplicationProtocolConfigNPNprivate static io.netty.handler.ssl.ApplicationProtocolConfigNPN_AND_ALPNprivate static java.lang.StringOPENJSSE_PROVIDER_NAMEprivate static java.lang.StringSUN_PROVIDER_NAME
-
Constructor Summary
Constructors Modifier Constructor Description privateGrpcSslContexts()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.handler.ssl.SslContextBuilderconfigure(io.netty.handler.ssl.SslContextBuilder builder)Set ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderconfigure(io.netty.handler.ssl.SslContextBuilder builder, io.netty.handler.ssl.SslProvider provider)Set ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderconfigure(io.netty.handler.ssl.SslContextBuilder builder, java.security.Provider jdkProvider)Set ciphers and APN appropriate for gRPC.private static io.netty.handler.ssl.SslProviderdefaultSslProvider()Returns OpenSSL if available, otherwise returns the JDK provider.(package private) static voidensureAlpnAndH2Enabled(io.netty.handler.ssl.ApplicationProtocolNegotiator alpnNegotiator)private static java.security.ProviderfindJdkProvider()static io.netty.handler.ssl.SslContextBuilderforClient()Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderforServer(java.io.File keyCertChainFile, java.io.File keyFile)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderforServer(java.io.File keyCertChainFile, java.io.File keyFile, java.lang.String keyPassword)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderforServer(java.io.InputStream keyCertChain, java.io.InputStream key)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.static io.netty.handler.ssl.SslContextBuilderforServer(java.io.InputStream keyCertChain, java.io.InputStream key, java.lang.String keyPassword)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
HTTP2_VERSION
private static final java.lang.String HTTP2_VERSION
- See Also:
- Constant Field Values
-
NEXT_PROTOCOL_VERSIONS
private static final java.util.List<java.lang.String> NEXT_PROTOCOL_VERSIONS
-
ALPN
private static final io.netty.handler.ssl.ApplicationProtocolConfig ALPN
-
NPN
private static final io.netty.handler.ssl.ApplicationProtocolConfig NPN
-
NPN_AND_ALPN
private static final io.netty.handler.ssl.ApplicationProtocolConfig NPN_AND_ALPN
-
SUN_PROVIDER_NAME
private static final java.lang.String SUN_PROVIDER_NAME
- See Also:
- Constant Field Values
-
IBM_PROVIDER_NAME
private static final java.lang.String IBM_PROVIDER_NAME
- See Also:
- Constant Field Values
-
OPENJSSE_PROVIDER_NAME
private static final java.lang.String OPENJSSE_PROVIDER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
forClient
public static io.netty.handler.ssl.SslContextBuilder forClient()
Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.- See Also:
SslContextBuilder.forClient(),configure(SslContextBuilder)
-
forServer
public static io.netty.handler.ssl.SslContextBuilder forServer(java.io.File keyCertChainFile, java.io.File keyFile)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.- See Also:
SslContextBuilder.forServer(File, File),configure(SslContextBuilder)
-
forServer
public static io.netty.handler.ssl.SslContextBuilder forServer(java.io.File keyCertChainFile, java.io.File keyFile, java.lang.String keyPassword)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.- See Also:
SslContextBuilder.forServer(File, File, String),configure(SslContextBuilder)
-
forServer
public static io.netty.handler.ssl.SslContextBuilder forServer(java.io.InputStream keyCertChain, java.io.InputStream key)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.- See Also:
SslContextBuilder.forServer(InputStream, InputStream),configure(SslContextBuilder)
-
forServer
public static io.netty.handler.ssl.SslContextBuilder forServer(java.io.InputStream keyCertChain, java.io.InputStream key, java.lang.String keyPassword)Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.- See Also:
SslContextBuilder.forServer(InputStream, InputStream, String),configure(SslContextBuilder)
-
configure
@CanIgnoreReturnValue public static io.netty.handler.ssl.SslContextBuilder configure(io.netty.handler.ssl.SslContextBuilder builder)
Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if an application requires particular settings it should override the options set here.
-
configure
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1784") @CanIgnoreReturnValue public static io.netty.handler.ssl.SslContextBuilder configure(io.netty.handler.ssl.SslContextBuilder builder, io.netty.handler.ssl.SslProvider provider)
Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if an application requires particular settings it should override the options set here.
-
configure
@CanIgnoreReturnValue public static io.netty.handler.ssl.SslContextBuilder configure(io.netty.handler.ssl.SslContextBuilder builder, java.security.Provider jdkProvider)Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if an application requires particular settings it should override the options set here.
-
defaultSslProvider
private static io.netty.handler.ssl.SslProvider defaultSslProvider()
Returns OpenSSL if available, otherwise returns the JDK provider.
-
findJdkProvider
private static java.security.Provider findJdkProvider()
-
ensureAlpnAndH2Enabled
static void ensureAlpnAndH2Enabled(io.netty.handler.ssl.ApplicationProtocolNegotiator alpnNegotiator)
-
-