mirror of https://github.com/grpc/grpc-java.git
docs
This commit is contained in:
parent
cb317c736c
commit
75e291f062
|
@ -55,6 +55,10 @@ public class GrpcSslContexts {
|
|||
|
||||
static final Set<String> HTTP2_VERSIONS = ImmutableSet.of("h2");
|
||||
|
||||
/*
|
||||
* These configs use ACCEPT due to limited support in OpenSSL. Actual protocol enforcement is
|
||||
* done in ProtocolNegotiators.
|
||||
*/
|
||||
private static ApplicationProtocolConfig ALPN = new ApplicationProtocolConfig(
|
||||
Protocol.ALPN,
|
||||
SelectorFailureBehavior.NO_ADVERTISE,
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
package io.grpc.netty;
|
||||
|
||||
import static io.grpc.netty.GrpcSslContexts.HTTP2_VERSIONS;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import io.grpc.Status;
|
||||
|
@ -100,7 +102,7 @@ public final class ProtocolNegotiators {
|
|||
if (evt instanceof SslHandshakeCompletionEvent) {
|
||||
SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt;
|
||||
if (handshakeEvent.isSuccess()) {
|
||||
if (GrpcSslContexts.HTTP2_VERSIONS.contains(sslHandler(ctx).applicationProtocol())) {
|
||||
if (HTTP2_VERSIONS.contains(sslHandler(ctx).applicationProtocol())) {
|
||||
// Successfully negotiated the protocol. Replace this handler with
|
||||
// the GRPC handler.
|
||||
ctx.pipeline().replace(this, null, grpcHandler);
|
||||
|
|
Loading…
Reference in New Issue