Search in sources :

Example 6 with TlsNegotiator

use of io.grpc.netty.ProtocolNegotiators.TlsNegotiator in project grpc-java by grpc.

the class ProtocolNegotiatorsTest method tls_host.

@Test
public void tls_host() throws SSLException {
    SslContext ctx = GrpcSslContexts.forClient().build();
    TlsNegotiator negotiator = (TlsNegotiator) ProtocolNegotiators.tls(ctx, "[::1]");
    assertEquals("[::1]", negotiator.getHost());
    assertEquals(-1, negotiator.getPort());
}
Also used : TlsNegotiator(io.grpc.netty.ProtocolNegotiators.TlsNegotiator) SslContext(io.netty.handler.ssl.SslContext) Test(org.junit.Test)

Aggregations

TlsNegotiator (io.grpc.netty.ProtocolNegotiators.TlsNegotiator)6 Test (org.junit.Test)6 SslContext (io.netty.handler.ssl.SslContext)3