# Delegate VerifyPeerCallback (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerCallback)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.VerifyPeerCallback)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.VerifyPeerCallback)

    public delegate bool VerifyPeerCallback(VerifyPeerContext context)

Callback invoked with the expected targetHost and the peer's certificate.
If false is returned by this callback then it is treated as a
verification failure and the attempted connection will fail.
Invocation of the callback is blocking, so any
implementation should be light-weight.
Note that the callback can potentially be invoked multiple times,
concurrently from different threads (e.g. when multiple connections
are being created for the same credentials).

## Namespace

[Grpc.Core](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)

## Assembly

Grpc.Core.Api.dll

| ## Parameter ||
|---|---|
| **Name** | **Description** |
| `context` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerContext` The [VerifyPeerContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerContext) associated with the callback |

| ## Returns ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` | true if verification succeeded, false otherwise. |