Skip to content

Commit

Permalink
grpc: Replace WithInsecure
Browse files Browse the repository at this point in the history
grpc.WithInsecure has been deprecated, replaced with the suggested
alterative.
  • Loading branch information
codebien committed Apr 13, 2022
1 parent b2b5343 commit 043f356
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/modules/k6/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
grpcstats "google.golang.org/grpc/stats"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -151,7 +152,7 @@ func (c *Client) Connect(addr string, params map[string]interface{}) (bool, erro

opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(tlsCfg)))
} else {
opts = append(opts, grpc.WithInsecure())
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
}

if ua := state.Options.UserAgent; ua.Valid {
Expand Down

0 comments on commit 043f356

Please sign in to comment.