diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index f1123fab5..990aa5bb4 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" tmsync "github.com/tendermint/tendermint/internal/libs/sync" @@ -95,7 +96,10 @@ func (cli *grpcClient) OnStart() 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 64705d0e0..8b8691e37 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" @@ -147,7 +148,10 @@ func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) { }) // 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 cce309328..ebdcbbcd3 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ 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 ) diff --git a/go.sum b/go.sum index 7bdf82276..a98212e8c 100644 --- a/go.sum +++ b/go.sum @@ -1620,8 +1620,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 413acca8e..a17b76676 100644 --- a/privval/grpc/util.go +++ b/privval/grpc/util.go @@ -16,6 +16,7 @@ import ( tmnet "github.com/tendermint/tendermint/libs/net" grpc "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/keepalive" ) @@ -98,7 +99,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!") } diff --git a/rpc/grpc/client_server.go b/rpc/grpc/client_server.go index e5164dc64..2b6ea2b91 100644 --- a/rpc/grpc/client_server.go +++ b/rpc/grpc/client_server.go @@ -5,6 +5,7 @@ import ( "net" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/tendermint/tendermint/internal/rpc/core" tmnet "github.com/tendermint/tendermint/libs/net" @@ -28,7 +29,10 @@ func StartGRPCServer(env *core.Environment, ln net.Listener) error { // StartGRPCClient dials the gRPC server using protoAddr and returns a new // BroadcastAPIClient. func StartGRPCClient(protoAddr string) BroadcastAPIClient { - conn, err := grpc.Dial(protoAddr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) + conn, err := grpc.Dial(protoAddr, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(dialerFunc), + ) if err != nil { panic(err) }