chore: use grpc.WithTransportCredentials and insecure.NewCredentials() instead of grpc.WithInsecure (#1798)
Signed-off-by: chenquan <chenquan.dev@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/zrpc/resolver"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -68,7 +69,7 @@ func (c *client) buildDialOptions(opts ...ClientOption) []grpc.DialOption {
|
||||
|
||||
var options []grpc.DialOption
|
||||
if !cliOpts.Secure {
|
||||
options = append([]grpc.DialOption(nil), grpc.WithInsecure())
|
||||
options = append([]grpc.DialOption(nil), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
}
|
||||
|
||||
if !cliOpts.NonBlock {
|
||||
|
||||
Reference in New Issue
Block a user