Package io.grpc.netty
Class ProtocolNegotiators
java.lang.Object
io.grpc.netty.ProtocolNegotiators
Common
ProtocolNegotiator
s used by gRPC.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
(package private) static final class
private static final class
static final class
static final class
(package private) static final class
Adapts aProtocolNegotiationEvent
to theGrpcHttp2ConnectionHandler
.(package private) static final class
A tuple of (host, port).(package private) static final class
Acts as a combination of Http2Upgrade andProtocolNegotiators.GrpcNegotiationHandler
.(package private) static final class
A negotiator that only does plain text.(package private) static final class
(package private) static final class
(package private) static final class
private static final class
(package private) static class
ProtocolNegotiationHandler is a convenience handler that makes it easy to follow the rules for protocol negotiation.(package private) static final class
A Proxy handler followsProtocolNegotiators.ProtocolNegotiationHandler
pattern.(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
Waits for the channel to be active, and then installs the next Handler. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Logger
private static final EnumSet
<TlsServerCredentials.Feature> private static final EnumSet
<TlsChannelCredentials.Feature> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfixedServerFactory
(ProtocolNegotiator negotiator) from
(ChannelCredentials creds) from
(ServerCredentials creds) static ProtocolNegotiator
httpProxy
(SocketAddress proxyAddress, String proxyUsername, String proxyPassword, ProtocolNegotiator negotiator) Returns aProtocolNegotiator
that does HTTP CONNECT proxy negotiation.(package private) static void
logSslEngineDetails
(Level level, io.netty.channel.ChannelHandlerContext ctx, String msg, Throwable t) (package private) static ProtocolNegotiators.HostPort
parseAuthority
(String authority) static ProtocolNegotiator
Returns aChannelHandler
that ensures that thehandler
is added to the pipeline writes to theChannel
may happen immediately, even before it is active.static ProtocolNegotiator
Returns aProtocolNegotiator
used for upgrading to HTTP/2 from HTTP/1.x.static ProtocolNegotiator
Create a server plaintext handler for gRPC.Create a server plaintext handler factory for gRPC.static ProtocolNegotiator
serverTls
(io.netty.handler.ssl.SslContext sslContext) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.static ProtocolNegotiator
serverTls
(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.serverTlsFactory
(io.netty.handler.ssl.SslContext sslContext) static ProtocolNegotiator
tls
(io.netty.handler.ssl.SslContext sslContext) Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.static ProtocolNegotiator
tls
(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable) Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.tlsClientFactory
(io.netty.handler.ssl.SslContext sslContext) private static RuntimeException
-
Field Details
-
log
-
understoodTlsFeatures
-
understoodServerTlsFeatures
-
-
Constructor Details
-
ProtocolNegotiators
private ProtocolNegotiators()
-
-
Method Details
-
from
-
from
-
fixedServerFactory
-
serverPlaintext
Create a server plaintext handler for gRPC. -
serverPlaintextFactory
Create a server plaintext handler factory for gRPC. -
serverTlsFactory
public static ProtocolNegotiator.ServerFactory serverTlsFactory(io.netty.handler.ssl.SslContext sslContext) -
serverTls
public static ProtocolNegotiator serverTls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.- Parameters:
executorPool
- a dedicatedExecutor
pool for time-consuming TLS tasks
-
serverTls
Create a server TLS handler for HTTP/2 capable of using ALPN/NPN. -
httpProxy
public static ProtocolNegotiator httpProxy(SocketAddress proxyAddress, @Nullable String proxyUsername, @Nullable String proxyPassword, ProtocolNegotiator negotiator) Returns aProtocolNegotiator
that does HTTP CONNECT proxy negotiation. -
parseAuthority
-
tls
public static ProtocolNegotiator tls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable) Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete.- Parameters:
executorPool
- a dedicatedExecutor
pool for time-consuming TLS tasks
-
tls
Returns aProtocolNegotiator
that ensures the pipeline is set up so that TLS will be negotiated, thehandler
is added and writes to theChannel
may happen immediately, even before the TLS Handshake is complete. -
tlsClientFactory
public static ProtocolNegotiator.ClientFactory tlsClientFactory(io.netty.handler.ssl.SslContext sslContext) -
plaintextUpgrade
Returns aProtocolNegotiator
used for upgrading to HTTP/2 from HTTP/1.x. -
plaintextUpgradeClientFactory
-
plaintext
Returns aChannelHandler
that ensures that thehandler
is added to the pipeline writes to theChannel
may happen immediately, even before it is active. -
plaintextClientFactory
-
logSslEngineDetails
-