Class SslPolicyManager

Namespace: System.Net.Security

Manages the SSL policy for the System.Net namespace.

public static class SslPolicyManager

Requirements

Platform

.NET Framework 4.5, .NET Framework 4.0, .NET Framework 3.5, .NET Framework 3.0, .NET Framework 2.0

Developer Compatibility

.NET Framework 2.0

Inheritance

Object
SslPolicyManager

Remarks

The SslPolicyManager class provides a way to globally configure the SSL policy for all System.Net applications.

By default, .NET applications will reject any SSL certificate that is not trusted by the operating system's certificate store or that has expired. This is a security best practice.

You can customize this behavior by implementing an ICertificatePolicy interface and assigning it to the SslPolicyManager.CertificatePolicy property.

Note: Modifying the SSL policy can have security implications. Ensure you understand the risks before making changes.

Methods

public static ICertificatePolicy SetCertificatePolicy(ICertificatePolicy policy)

Sets the SSL certificate policy for the System.Net namespace.

public static ICertificatePolicy GetCertificatePolicy()

Gets the current SSL certificate policy for the System.Net namespace.

Properties

public static ICertificatePolicy CertificatePolicy { get; set; }

Gets or sets the certificate policy used to validate SSL certificates.

See Also