diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index ee35646f9..7d3351f7e 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -8,6 +8,7 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" @@ -105,7 +106,10 @@ func (cli *grpcClient) OnStart(ctx context.Context) error { RETRY_LOOP: for { - conn, err := grpc.Dial(cli.addr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) + conn, err := grpc.Dial(cli.addr, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialerFunc), + ) if err != nil { if cli.mustConnect { return err diff --git a/abci/example/example_test.go b/abci/example/example_test.go index 80d5a3130..f32d9df7c 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/tendermint/tendermint/libs/log" tmnet "github.com/tendermint/tendermint/libs/net" @@ -142,7 +143,10 @@ func testGRPCSync(ctx context.Context, t *testing.T, app types.ABCIApplicationSe t.Cleanup(func() { server.Wait() }) // Connect to the socket - conn, err := grpc.Dial(socket, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) + conn, err := grpc.Dial(socket, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialerFunc), + ) if err != nil { t.Fatalf("Error dialing GRPC server: %v", err.Error()) } diff --git a/go.mod b/go.mod index df894ee4f..457a37a22 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,8 @@ require ( golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - google.golang.org/grpc v1.42.0 + google.golang.org/grpc v1.43.0 + gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect pgregory.net/rapid v0.4.7 ) @@ -195,7 +196,6 @@ require ( golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 8c303dca0..0ada1103c 100644 --- a/go.sum +++ b/go.sum @@ -1612,8 +1612,9 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/privval/grpc/client_test.go b/privval/grpc/client_test.go index 98730df19..939a1989f 100644 --- a/privval/grpc/client_test.go +++ b/privval/grpc/client_test.go @@ -6,7 +6,8 @@ import ( "testing" "time" - grpc "google.golang.org/grpc" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/test/bufconn" "github.com/stretchr/testify/assert" @@ -51,7 +52,10 @@ func TestSignerClient_GetPubKey(t *testing.T) { srv, dialer := dialer(mockPV, logger) defer srv.Stop() - conn, err := grpc.DialContext(ctx, "", grpc.WithInsecure(), grpc.WithContextDialer(dialer)) + conn, err := grpc.DialContext(ctx, "", + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialer), + ) if err != nil { panic(err) } @@ -73,7 +77,10 @@ func TestSignerClient_SignVote(t *testing.T) { srv, dialer := dialer(mockPV, logger) defer srv.Stop() - conn, err := grpc.DialContext(ctx, "", grpc.WithInsecure(), grpc.WithContextDialer(dialer)) + conn, err := grpc.DialContext(ctx, "", + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialer), + ) if err != nil { panic(err) } @@ -126,7 +133,10 @@ func TestSignerClient_SignProposal(t *testing.T) { srv, dialer := dialer(mockPV, logger) defer srv.Stop() - conn, err := grpc.DialContext(ctx, "", grpc.WithInsecure(), grpc.WithContextDialer(dialer)) + conn, err := grpc.DialContext(ctx, "", + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialer), + ) if err != nil { panic(err) } diff --git a/privval/grpc/util.go b/privval/grpc/util.go index 7e0483f9c..a73fd65b1 100644 --- a/privval/grpc/util.go +++ b/privval/grpc/util.go @@ -15,6 +15,7 @@ import ( tmnet "github.com/tendermint/tendermint/libs/net" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/keepalive" ) @@ -97,7 +98,7 @@ func DialRemoteSigner( transportSecurity = GenerateTLS(cfg.ClientCertificateFile(), cfg.ClientKeyFile(), cfg.RootCAFile(), logger) } else { - transportSecurity = grpc.WithInsecure() + transportSecurity = grpc.WithTransportCredentials(insecure.NewCredentials()) logger.Info("Using an insecure gRPC connection!") }