We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5194248 commit 4eee7b9Copy full SHA for 4eee7b9
cmd/client/cli/cli.go
@@ -2,13 +2,15 @@ package cli
2
3
import (
4
"context"
5
+ "crypto/tls"
6
"errors"
7
"fmt"
8
9
"github.com/denisbrodbeck/machineid"
10
"github.com/sirupsen/logrus"
11
"github.com/spf13/viper"
12
"google.golang.org/grpc"
13
+ "google.golang.org/grpc/credentials"
14
"google.golang.org/grpc/credentials/insecure"
15
"google.golang.org/grpc/encoding/gzip"
16
@@ -45,6 +47,8 @@ func (cmd *baseCLI) client() (*client.Client, error) {
45
47
opts,
46
48
grpc.WithTransportCredentials(insecure.NewCredentials()),
49
)
50
+ } else {
51
+ opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})))
52
}
53
conn, err := grpc.Dial(cmd.cfg.Host, opts...)
54
if err != nil {
0 commit comments