diff --git a/cmd/gctcli/main.go b/cmd/gctcli/main.go index 7b08ba542b6..a8b517c3de6 100644 --- a/cmd/gctcli/main.go +++ b/cmd/gctcli/main.go @@ -21,6 +21,7 @@ var ( username string password string pairDelimiter string + certPath string ) func jsonOutput(in interface{}) { @@ -32,8 +33,7 @@ func jsonOutput(in interface{}) { } func setupClient() (*grpc.ClientConn, error) { - targetPath := filepath.Join(common.GetDefaultDataDir(runtime.GOOS), "tls", "cert.pem") - creds, err := credentials.NewClientTLSFromFile(targetPath, "") + creds, err := credentials.NewClientTLSFromFile(certPath, "") if err != nil { return nil, err } @@ -83,6 +83,12 @@ func main() { Usage: "the default currency pair delimiter used to standardise currency pair input", Destination: &pairDelimiter, }, + cli.StringFlag{ + Name: "cert", + Value: filepath.Join(common.GetDefaultDataDir(runtime.GOOS), "tls", "cert.pem"), + Usage: "the path to TLS cert of the gRPC server", + Destination: &certPath, + }, } app.Commands = []cli.Command{ getInfoCommand,