SslStream.EndAuthenticateAsServer(IAsyncResult) Método

Definição

Encerra uma operação assíncrona de autenticação de cliente pendente iniciada com uma chamada anterior para BeginAuthenticateAsClient.Ends a pending asynchronous client authentication operation started with a previous call to BeginAuthenticateAsClient.

public:
 virtual void EndAuthenticateAsServer(IAsyncResult ^ asyncResult);
public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult);
abstract member EndAuthenticateAsServer : IAsyncResult -> unit
override this.EndAuthenticateAsServer : IAsyncResult -> unit
Public Overridable Sub EndAuthenticateAsServer (asyncResult As IAsyncResult)

Parâmetros

asyncResult
IAsyncResult

Uma instância IAsyncResult retornada por uma chamada a BeginAuthenticateAsClient.An IAsyncResult instance returned by a call to BeginAuthenticateAsClient.

Exceções

asyncResult é null.asyncResult is null.

O asyncResult não foi criado por uma chamada a BeginAuthenticateAsClient.asyncResult was not created by a call to BeginAuthenticateAsClient.

A autenticação falhou e deixou esse objeto em um estado inutilizável.The authentication failed and left this object in an unusable state.

Nenhuma autenticação de cliente pendente a ser concluída.There is no pending client authentication to complete.

Comentários

Se a operação não tiver sido concluída, esse método será bloqueado até que ele seja.If the operation has not completed, this method blocks until it does. Quando a autenticação for realizada com sucesso, você deve verificar as IsEncrypted IsSigned Propriedades e para determinar quais serviços de segurança são usados pelo SslStream .When the authentication succeeds, you must check the IsEncrypted and IsSigned properties to determine what security services are used by the SslStream. Verifique a IsMutuallyAuthenticated propriedade para determinar se a autenticação mútua ocorreu.Check the IsMutuallyAuthenticated property to determine whether mutual authentication occurred.

Se a autenticação falhar, você receberá um AuthenticationException , e isso SslStream não será mais utilizável.If the authentication fails, you receive a AuthenticationException, and this SslStream is no longer useable. Você deve fechar esse objeto e remover todas as referências a ele para que ele possa ser coletado pelo coletor de lixo.You should close this object and remove all references to it so that it can be collected by the garbage collector.

Para executar essa operação de forma síncrona, use um dos AuthenticateAsClient métodos.To perform this operation synchronously, use one of the AuthenticateAsClient method.

Aplica-se a