SslStream.SslProtocol Property

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a value that indicates the security protocol used to authenticate this connection.

C#
public virtual System.Security.Authentication.SslProtocols SslProtocol { get; }

Property Value

The SslProtocols value that represents protocols used for authentication.

Examples

The following example displays the security properties of the specified stream.

C#
static void DisplaySecurityLevel(SslStream stream)
{
   Console.WriteLine("Cipher: {0} strength {1}", stream.CipherAlgorithm, stream.CipherStrength);
   Console.WriteLine("Hash: {0} strength {1}", stream.HashAlgorithm, stream.HashStrength);
   Console.WriteLine("Key exchange: {0} strength {1}", stream.KeyExchangeAlgorithm, stream.KeyExchangeStrength);
   Console.WriteLine("Protocol: {0}", stream.SslProtocol);
}

Remarks

The enabled security protocols can be specified in AuthenticateAsClient or via EnabledSslProtocols and AuthenticateAsServer or EnabledSslProtocols. If no security protocol was explicitly specified, the Default value is used.

The actual protocol used for authentication is selected based on the ones supported by the client and server.

Applies to

Produkt Verzie
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1