List of usage examples for io.netty.handler.ssl SslContext applicationProtocolNegotiator
public abstract ApplicationProtocolNegotiator applicationProtocolNegotiator();
From source file:io.grpc.netty.NettyChannelBuilder.java
License:Apache License
/** * SSL/TLS context to use instead of the system default. It must have been configured with {@link * GrpcSslContexts}, but options could have been overridden. *///from w w w.j a va2 s . c om public NettyChannelBuilder sslContext(SslContext sslContext) { if (sslContext != null) { checkArgument(sslContext.isClient(), "Server SSL context can not be used for client channel"); GrpcSslContexts.ensureAlpnAndH2Enabled(sslContext.applicationProtocolNegotiator()); } this.sslContext = sslContext; return this; }
From source file:io.grpc.netty.NettyServerBuilder.java
License:Apache License
/** * Sets the TLS context to use for encryption. Providing a context enables encryption. It must * have been configured with {@link GrpcSslContexts}, but options could have been overridden. *//* ww w .ja v a 2 s . co m*/ public NettyServerBuilder sslContext(SslContext sslContext) { if (sslContext != null) { checkArgument(sslContext.isServer(), "Client SSL context can not be used for server"); GrpcSslContexts.ensureAlpnAndH2Enabled(sslContext.applicationProtocolNegotiator()); } this.sslContext = sslContext; return this; }