From 847cee60e2f8ddcd561a835c9b9c47b3f30be2b0 Mon Sep 17 00:00:00 2001 From: Antonio Pitasi Date: Tue, 16 Jul 2024 11:09:30 +0200 Subject: [PATCH] fix(go-client): correctly setup TLS credentials --- go-client/query_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go-client/query_client.go b/go-client/query_client.go index fe951f4ee..c9b617a74 100644 --- a/go-client/query_client.go +++ b/go-client/query_client.go @@ -1,7 +1,10 @@ package client import ( + "crypto/tls" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" insecurecreds "google.golang.org/grpc/credentials/insecure" ) @@ -23,6 +26,9 @@ func NewQueryClient(url string, insecure bool) (*QueryClient, error) { opts := []grpc.DialOption{} if insecure { opts = append(opts, grpc.WithTransportCredentials(insecurecreds.NewCredentials())) + } else { + creds := credentials.NewTLS(&tls.Config{InsecureSkipVerify: false}) + opts = append(opts, grpc.WithTransportCredentials(creds)) } grpcConn, err := grpc.NewClient(url, opts...) if err != nil {