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 Object
Utility for configuring SslContext for gRPC.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final io.netty.handler.ssl.ApplicationProtocolConfig
     
    private static final String
     
    private static final String
     
    private static final Logger
     
    private static final List<String>
     
    private static final io.netty.handler.ssl.ApplicationProtocolConfig
     
    private static final io.netty.handler.ssl.ApplicationProtocolConfig
     
    private static final String
     
    private static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.netty.handler.ssl.SslContextBuilder
    configure(io.netty.handler.ssl.SslContextBuilder builder)
    Set ciphers and APN appropriate for gRPC.
    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.
    static io.netty.handler.ssl.SslContextBuilder
    configure(io.netty.handler.ssl.SslContextBuilder builder, Provider jdkProvider)
    Set ciphers and APN appropriate for gRPC.
    private static io.netty.handler.ssl.SslProvider
    Returns OpenSSL if available, otherwise returns the JDK provider.
    (package private) static void
    ensureAlpnAndH2Enabled(io.netty.handler.ssl.ApplicationProtocolNegotiator alpnNegotiator)
     
    private static Provider
     
    static io.netty.handler.ssl.SslContextBuilder
    Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
    static io.netty.handler.ssl.SslContextBuilder
    forServer(File keyCertChainFile, File keyFile)
    Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
    static io.netty.handler.ssl.SslContextBuilder
    forServer(File keyCertChainFile, File keyFile, String keyPassword)
    Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
    static io.netty.handler.ssl.SslContextBuilder
    forServer(InputStream keyCertChain, InputStream key)
    Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
    static io.netty.handler.ssl.SslContextBuilder
    forServer(InputStream keyCertChain, InputStream key, String keyPassword)
    Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static final Logger logger
    • HTTP2_VERSION

      private static final String HTTP2_VERSION
      See Also:
    • NEXT_PROTOCOL_VERSIONS

      private static final List<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 String SUN_PROVIDER_NAME
      See Also:
    • IBM_PROVIDER_NAME

      private static final String IBM_PROVIDER_NAME
      See Also:
    • OPENJSSE_PROVIDER_NAME

      private static final String OPENJSSE_PROVIDER_NAME
      See Also:
  • Constructor Details

    • GrpcSslContexts

      private GrpcSslContexts()
  • Method Details

    • forClient

      public static io.netty.handler.ssl.SslContextBuilder forClient()
      Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
      See Also:
    • forServer

      public static io.netty.handler.ssl.SslContextBuilder forServer(File keyCertChainFile, File keyFile)
      Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
      See Also:
    • forServer

      public static io.netty.handler.ssl.SslContextBuilder forServer(File keyCertChainFile, File keyFile, String keyPassword)
      Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
      See Also:
    • forServer

      public static io.netty.handler.ssl.SslContextBuilder forServer(InputStream keyCertChain, InputStream key)
      Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
      See Also:
    • forServer

      public static io.netty.handler.ssl.SslContextBuilder forServer(InputStream keyCertChain, InputStream key, String keyPassword)
      Creates an SslContextBuilder with ciphers and APN appropriate for gRPC.
      See Also:
    • 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, 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 Provider findJdkProvider()
    • ensureAlpnAndH2Enabled

      static void ensureAlpnAndH2Enabled(io.netty.handler.ssl.ApplicationProtocolNegotiator alpnNegotiator)