SslAuthenticationOptions()
Initializes a new instance of the SslAuthenticationOptions class with default settings.
public SslAuthenticationOptions()
System.Net.Security.SslAuthenticationOptions ClassProvides options for configuring SSL/TLS authentication for network connections.
The SslAuthenticationOptions class is used to specify granular control over how SSL/TLS certificates are validated and trusted when establishing secure network connections. It allows developers to customize certificate chain validation, hostname matching, and the use of specific certificate policies. This class is typically used in conjunction with classes like SslStream and HttpClientHandler to enforce custom security behaviors.
By leveraging SslAuthenticationOptions, applications can implement more robust and tailored security strategies for sensitive network communications.
public sealed class SslAuthenticationOptions
When creating an SslAuthenticationOptions object, you can configure various aspects of the SSL/TLS handshake and certificate validation process. This includes:
This class is part of the System.Net.Security namespace, providing fundamental building blocks for secure network programming in .NET.
The SslAuthenticationOptions class has the following constructors:
SslAuthenticationOptions()
Initializes a new instance of the SslAuthenticationOptions class with default settings.
public SslAuthenticationOptions()
The SslAuthenticationOptions class exposes the following properties:
RemoteCertificateValidationCallbackGets or sets a delegate that contains the callback method to validate the server's certificate.
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
A RemoteCertificateValidationCallback delegate that represents the callback method for validating the server's certificate. The default is null, which means that the system's default certificate validation logic is used.
ClientCertificateOptionsGets or sets an enum that specifies whether to send the client certificate to the server.
public ClientCertificateOption ClientCertificateOptions { get; set; }
A ClientCertificateOption value that indicates whether to send the client certificate to the server. The default is ClientCertificateOption.Manual.
TargetHostGets or sets the target host for which the certificate is intended.
public string TargetHost { get; set; }
A string that represents the target host.
The SslAuthenticationOptions class does not define any public methods beyond those inherited from System.Object.
The SslAuthenticationOptions class does not define any public events.
| Assembly | File |
|---|---|
| System.Net.Security.dll | C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Net.Security.dll |
| Framework | Versions Supported |
|---|---|
| .NET Core | 3.1, 3.0, 2.2, 2.1, 2.0 |
| .NET Framework | 4.8, 4.7.2, 4.7.1, 4.7, 4.6.2, 4.6.1, 4.6, 4.5.2, 4.5.1, 4.5, 4.0 |