# Class SslCredentials (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.SslCredentials)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.SslCredentials)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.SslCredentials)

    public sealed class SslCredentials : ChannelCredentials

Client-side SSL credentials.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ChannelCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials) \> SslCredentials

## Inherited Members

[ChannelCredentials.Insecure](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_Insecure) [ChannelCredentials.SecureSsl](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_SecureSsl) [ChannelCredentials.Create(ChannelCredentials, CallCredentials)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_Create_Grpc_Core_ChannelCredentials_Grpc_Core_CallCredentials_) [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Grpc.Core.Api.dll

## Constructors

### SslCredentials()

    public SslCredentials()

Creates client-side SSL credentials loaded from
disk file pointed to by the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable.
If that fails, gets the roots certificates from a well known place on disk.

### SslCredentials(string)

    public SslCredentials(string rootCertificates)

Creates client-side SSL credentials from
a string containing PEM encoded root certificates.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `rootCertificates` | `https://learn.microsoft.com/dotnet/api/system.string` |

### SslCredentials(string, KeyCertificatePair)

    public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair)

Creates client-side SSL credentials.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `rootCertificates` | `https://learn.microsoft.com/dotnet/api/system.string` string containing PEM encoded server root certificates. |
| `keyCertificatePair` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.KeyCertificatePair` a key certificate pair. |

### SslCredentials(string?, KeyCertificatePair?, VerifyPeerCallback?)

    public SslCredentials(string? rootCertificates, KeyCertificatePair? keyCertificatePair, VerifyPeerCallback? verifyPeerCallback)

Creates client-side SSL credentials.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `rootCertificates` | `https://learn.microsoft.com/dotnet/api/system.string` string containing PEM encoded server root certificates. |
| `keyCertificatePair` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.KeyCertificatePair` a key certificate pair. |
| `verifyPeerCallback` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerCallback` a callback to verify peer's target name and certificate. |

## Properties

### KeyCertificatePair

    public KeyCertificatePair? KeyCertificatePair { get; }

Client side key and certificate pair.
If null, client will not use key and certificate pair.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.KeyCertificatePair` |   |

### RootCertificates

    public string? RootCertificates { get; }

PEM encoding of the server root certificates.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

## Methods

### InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase, object)

    public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state)

Populates channel credentials configurator with this instance's configuration.
End users never need to invoke this method as it is part of internal implementation.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `configurator` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentialsConfiguratorBase` |
| `state` | `https://learn.microsoft.com/dotnet/api/system.object` |

**Overrides** [ChannelCredentials.InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase, object)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_InternalPopulateConfiguration_Grpc_Core_ChannelCredentialsConfiguratorBase_System_Object_)