Skip to content

Commit

Permalink
fix(go-client): correctly setup TLS credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitasi committed Jul 16, 2024
1 parent c477f7c commit 847cee6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go-client/query_client.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand All @@ -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 {
Expand Down

0 comments on commit 847cee6

Please sign in to comment.