Fix a panic when management is behind an invalid proxy (#1930)

- Add a new error on gRPC client that doesn't pass the incorrect status from the gRPC client
- Try login only if we have a server public key
This commit is contained in:
Maycon Santos
2024-05-06 18:04:32 +02:00
committed by GitHub
parent 13b63eebc1
commit 7357a9954c
2 changed files with 3 additions and 2 deletions

View File

@@ -276,7 +276,8 @@ func (c *GrpcClient) GetServerPublicKey() (*wgtypes.Key, error) {
defer cancel()
resp, err := c.realClient.GetServerKey(mgmCtx, &proto.Empty{})
if err != nil {
return nil, err
log.Errorf("failed while getting Management Service public key: %v", err)
return nil, fmt.Errorf("failed while getting Management Service public key")
}
serverKey, err := wgtypes.ParseKey(resp.Key)