Other: Use proper gRPC insecure credentials

This commit is contained in:
James Houlahan
2022-10-08 01:20:26 +02:00
parent 39b366ee69
commit 705875cff2

View File

@ -8,6 +8,7 @@ import (
"github.com/ProtonMail/proton-bridge/v2/internal/focus/proto" "github.com/ProtonMail/proton-bridge/v2/internal/focus/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/emptypb"
) )
@ -17,7 +18,11 @@ func TryRaise() bool {
ctx, cancel := context.WithTimeout(context.Background(), time.Second) ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel() defer cancel()
cc, err := grpc.DialContext(ctx, net.JoinHostPort(Host, fmt.Sprint(Port)), grpc.WithInsecure()) cc, err := grpc.DialContext(
ctx,
net.JoinHostPort(Host, fmt.Sprint(Port)),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil { if err != nil {
return false return false
} }