Example usage for io.netty.handler.ssl ApplicationProtocolNegotiator protocols

List of usage examples for io.netty.handler.ssl ApplicationProtocolNegotiator protocols

Introduction

In this page you can find the example usage for io.netty.handler.ssl ApplicationProtocolNegotiator protocols.

Prototype

List<String> protocols();

Source Link

Document

Get the collection of application protocols supported by this application (in preference order).

Usage

From source file:io.grpc.netty.GrpcSslContexts.java

License:Apache License

@SuppressWarnings("deprecation")
static void ensureAlpnAndH2Enabled(io.netty.handler.ssl.ApplicationProtocolNegotiator alpnNegotiator) {
    checkArgument(alpnNegotiator != null, "ALPN must be configured");
    checkArgument(alpnNegotiator.protocols() != null && !alpnNegotiator.protocols().isEmpty(),
            "ALPN must be enabled and list HTTP/2 as a supported protocol.");
    checkArgument(alpnNegotiator.protocols().contains(HTTP2_VERSION),
            "This ALPN config does not support HTTP/2. Expected %s, but got %s'.", HTTP2_VERSION,
            alpnNegotiator.protocols());
}