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) //