SslStream.SslProtocol Egenskap

Definition

Hämtar ett värde som anger det säkerhetsprotokoll som används för att autentisera den här anslutningen.

public:
 virtual property System::Security::Authentication::SslProtocols SslProtocol { System::Security::Authentication::SslProtocols get(); };
public virtual System.Security.Authentication.SslProtocols SslProtocol { get; }
member this.SslProtocol : System.Security.Authentication.SslProtocols
Public Overridable ReadOnly Property SslProtocol As SslProtocols

Egenskapsvärde

Värdet SslProtocols som representerar protokoll som används för autentisering.

Exempel

I följande exempel visas säkerhetsegenskaperna för den angivna strömmen.

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);
}
Private Shared Sub DisplaySecurityLevel(stream As SslStream)
    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)
End Sub

Kommentarer

De aktiverade säkerhetsprotokollen kan anges i AuthenticateAsClient eller via EnabledSslProtocols och AuthenticateAsServer eller EnabledSslProtocols. Om inget säkerhetsprotokoll uttryckligen angavs Default används värdet.

Det faktiska protokollet som används för autentisering väljs baserat på de som stöds av klienten och servern.

Gäller för