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.
public System.Net.Security.EncryptionPolicy EncryptionPolicy { get; set; }
Property Value
System.Net.Security.EncryptionPolicy
The encryption policy for the SSL stream.
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:
RequireEncryption: All data sent and received over the stream must be encrypted.AllowNoEncryption: Data can be sent and received without encryption. This is not recommended for sensitive data.NoEncryption: Data is never encrypted. This is generally not used with SSL/TLS.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.
| Interface | Value |
|---|---|
| Namespace | System.Net.Security |
| Assembly | System.Net.Security.dll |