SslValidationResultCode Enum
This enumeration defines the possible results of an SSL validation operation.
Namespace:
Assembly:
System (in System.dll)
Syntax
public enum SslValidationResultCode
Members
The following table lists the members of the SslValidationResultCode enumeration:
Remarks
When establishing an SSL/TLS connection, the client application often needs to validate the server's certificate. This enumeration provides a structured way to communicate the outcome of that validation process.
A value of Success indicates that the certificate is considered valid and trusted for the connection. Any other value signifies a problem with the certificate or the validation process, and the application should typically treat such connections as insecure.
Examples
The following C# code snippet demonstrates how to check the result of an SSL validation:
// Assuming 'validationResult' is a variable of type SslValidationResultCode
if (validationResult == SslValidationResultCode.Success) {
Console.WriteLine("SSL certificate validation successful.");
} else {
Console.WriteLine($"SSL certificate validation failed: {validationResult}");
}
Requirements
.NET Framework: Supported in versions 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.6, 4.7, 4.8.
.NET Core / .NET 5+: Supported.
Operating System: Windows 98, Windows Me, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows 8, Windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016, Windows Server 2019.