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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eSslCredentials\u003c/code\u003e is a sealed class in the \u003ccode\u003eGrpc.Core\u003c/code\u003e namespace designed for client-side SSL credentials, inheriting from \u003ccode\u003eChannelCredentials\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers constructors to create SSL credentials from either a file path specified by an environment variable, a string containing PEM-encoded root certificates, or with the addition of a \u003ccode\u003eKeyCertificatePair\u003c/code\u003e and/or a \u003ccode\u003eVerifyPeerCallback\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSslCredentials\u003c/code\u003e provides properties for managing root certificates and a key-certificate pair, with the \u003ccode\u003eKeyCertificatePair\u003c/code\u003e being optional.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInternalPopulateConfiguration\u003c/code\u003e method allows for populating the channel credentials configurator with the instance's configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe class also inherits multiple methods from ChannelCredentials and object, such as \u003ccode\u003eInsecure\u003c/code\u003e, \u003ccode\u003eSecureSsl\u003c/code\u003e, \u003ccode\u003eEquals\u003c/code\u003e, and \u003ccode\u003eGetHashCode\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class SslCredentials (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.SslCredentials)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.SslCredentials)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.SslCredentials) \n\n public sealed class SslCredentials : ChannelCredentials\n\nClient-side SSL credentials. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [ChannelCredentials](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials) \\\u003e SslCredentials \n\nInherited Members\n-----------------\n\n[ChannelCredentials.Insecure](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_Insecure) \n[ChannelCredentials.SecureSsl](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_SecureSsl) \n[ChannelCredentials.Create(ChannelCredentials, CallCredentials)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_Create_Grpc_Core_ChannelCredentials_Grpc_Core_CallCredentials_) \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nConstructors\n------------\n\n### SslCredentials()\n\n public SslCredentials()\n\nCreates client-side SSL credentials loaded from\ndisk file pointed to by the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable.\nIf that fails, gets the roots certificates from a well known place on disk.\n\n### SslCredentials(string)\n\n public SslCredentials(string rootCertificates)\n\nCreates client-side SSL credentials from\na string containing PEM encoded root certificates.\n\n### SslCredentials(string, KeyCertificatePair)\n\n public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair)\n\nCreates client-side SSL credentials.\n\n### SslCredentials(string?, KeyCertificatePair?, VerifyPeerCallback?)\n\n public SslCredentials(string? rootCertificates, KeyCertificatePair? keyCertificatePair, VerifyPeerCallback? verifyPeerCallback)\n\nCreates client-side SSL credentials.\n\nProperties\n----------\n\n### KeyCertificatePair\n\n public KeyCertificatePair? KeyCertificatePair { get; }\n\nClient side key and certificate pair.\nIf null, client will not use key and certificate pair.\n\n### RootCertificates\n\n public string? RootCertificates { get; }\n\nPEM encoding of the server root certificates.\n\nMethods\n-------\n\n### InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase, object)\n\n public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state)\n\nPopulates channel credentials configurator with this instance's configuration.\nEnd users never need to invoke this method as it is part of internal implementation.\n\n**Overrides** \n[ChannelCredentials.InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase, object)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials#Grpc_Core_ChannelCredentials_InternalPopulateConfiguration_Grpc_Core_ChannelCredentialsConfiguratorBase_System_Object_)"]]