Compartir vía


SslStream.IsServer Propiedad

Definición

Obtiene un valor Boolean que indica si el lado local de la conexión utilizada por SslStream se autenticó como el servidor.

public:
 virtual property bool IsServer { bool get(); };
public override bool IsServer { get; }
member this.IsServer : bool
Public Overrides ReadOnly Property IsServer As Boolean

Valor de propiedad

Es true si el extremo local se autenticó correctamente como servidor de la conexión autenticada; en caso contrario, es false.

Ejemplos

En el ejemplo de código siguiente se muestra el valor de esta propiedad.

static void DisplaySecurityServices( SslStream^ stream )
{
   Console::WriteLine( L"Is authenticated: {0} as server? {1}", stream->IsAuthenticated, stream->IsServer );
   Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
   Console::WriteLine( L"Is Encrypted: {0}", stream->IsEncrypted );
   Console::WriteLine( L"Is mutually authenticated: {0}", stream->IsMutuallyAuthenticated );
}
static void DisplaySecurityServices(SslStream stream)
{
   Console.WriteLine("Is authenticated: {0} as server? {1}", stream.IsAuthenticated, stream.IsServer);
   Console.WriteLine("IsSigned: {0}", stream.IsSigned);
   Console.WriteLine("Is Encrypted: {0}", stream.IsEncrypted);
   Console.WriteLine("Is mutually authenticated: {0}", stream.IsMutuallyAuthenticated);
}
Private Shared Sub DisplaySecurityServices(stream As SslStream)
    Console.WriteLine("Is authenticated: {0} as server? {1}", stream.IsAuthenticated, stream.IsServer)
    Console.WriteLine("IsSigned: {0}", stream.IsSigned)
    Console.WriteLine("Is Encrypted: {0}", stream.IsEncrypted)
    Console.WriteLine("Is mutually authenticated: {0}", stream.IsMutuallyAuthenticated)
End Sub

Comentarios

Si se produjo un error de autenticación o no se ha producido, esta propiedad devuelve false.

Para autenticarse como servidor, llame a los AuthenticateAsServer métodos o BeginAuthenticateAsServer .

Se aplica a