SSLStream.EncryptionPolicy Property

Summary

Gets or sets the encryption policy for the SSL stream. This property is not used by the SslStream class for establishing secure connections. Instead, it is used by the System.Net.Security.SslClientAuthenticationOptions.EncryptionPolicy property.

Syntax

public System.Net.Security.EncryptionPolicy EncryptionPolicy { get; set; }

Property Value

System.Net.Security.EncryptionPolicy

The encryption policy for the SSL stream.

Remarks

The EncryptionPolicy property is available on the SslStream class for backward compatibility with older code. However, it is recommended to use the System.Net.Security.SslClientAuthenticationOptions.EncryptionPolicy property when configuring client authentication options for an SslStream.

The EncryptionPolicy enumeration defines the following values:

When using SslClientAuthenticationOptions, you should set the EncryptionPolicy property to control the acceptable encryption levels for the server connection. For example, setting it to RequireEncryption ensures that an unencrypted connection will not be established.

Requirements

Interface Value
Namespace System.Net.Security
Assembly System.Net.Security.dll

See Also