diff --git a/pkg/daemon/BUILD.bazel b/pkg/daemon/BUILD.bazel index ad0a44f9db..56959d28c5 100644 --- a/pkg/daemon/BUILD.bazel +++ b/pkg/daemon/BUILD.bazel @@ -27,6 +27,7 @@ go_library( "//pkg/snet/path:go_default_library", "//private/topology:go_default_library", "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//credentials/insecure:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", ], diff --git a/pkg/daemon/grpc.go b/pkg/daemon/grpc.go index e501a5517d..16bf2e4df1 100644 --- a/pkg/daemon/grpc.go +++ b/pkg/daemon/grpc.go @@ -21,6 +21,7 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" @@ -48,15 +49,14 @@ type Service struct { } func (s Service) Connect(ctx context.Context) (Connector, error) { - a, err := net.ResolveTCPAddr("tcp", s.Address) + conn, err := grpc.NewClient(s.Address, + grpc.WithTransportCredentials(insecure.NewCredentials()), + libgrpc.UnaryClientInterceptor(), + libgrpc.StreamClientInterceptor(), + ) if err != nil { s.Metrics.incConnects(err) - return nil, serrors.Wrap("resolving addr", err) - } - conn, err := libgrpc.SimpleDialer{}.Dial(ctx, a) - if err != nil { - s.Metrics.incConnects(err) - return nil, serrors.Wrap("dialing", err) + return nil, serrors.Wrap("creating client", err) } s.Metrics.incConnects(nil) return grpcConn{conn: conn, metrics: s.Metrics}, nil