From f620045c459a07a1c553c2497dcfd703b1e74962 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 5 Mar 2024 18:10:41 +0800 Subject: [PATCH] fix: use java 1.8 methods --- ingester-grpc/src/main/java/io/greptime/rpc/GrpcClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ingester-grpc/src/main/java/io/greptime/rpc/GrpcClient.java b/ingester-grpc/src/main/java/io/greptime/rpc/GrpcClient.java index 562a938..18ac1cf 100644 --- a/ingester-grpc/src/main/java/io/greptime/rpc/GrpcClient.java +++ b/ingester-grpc/src/main/java/io/greptime/rpc/GrpcClient.java @@ -573,10 +573,10 @@ private IdChannel newChannel(Endpoint endpoint) { NettyChannelBuilder innerChannelBuilder = NettyChannelBuilder.forAddress(endpoint.getAddr(), endpoint.getPort()); - if (this.opts.getTlsOptions().isEmpty()) { - innerChannelBuilder.usePlaintext(); - } else { + if (this.opts.getTlsOptions().isPresent()) { innerChannelBuilder.useTransportSecurity().sslContext(newSslContext(this.opts.getTlsOptions().get())); + } else { + innerChannelBuilder.usePlaintext(); } ManagedChannel innerChannel = innerChannelBuilder.executor(this.asyncPool) //