System.Net.Security.SslStream.EndAuthenticateAsClient Method

Ends a pending asynchronous server authentication operation started with a previous call to erload:System.Net.Security.SslStream.BeginAuthenticateAsServer.

Syntax

public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)

Parameters

asyncResult
An IAsyncResult instance returned by a call to erload:System.Net.Security.SslStream.BeginAuthenticateAsServer.

Remarks

If the operation has not completed, this method blocks until it does. When the authentication succeeds, you must check the SslStream.IsEncrypted and SslStream.IsSigned properties to determine what security services are used by the System.Net.Security.SslStream. Check the SslStream.IsMutuallyAuthenticated property to determine whether mutual authentication occurred.

If the authentication fails, you receive a System.Security.Authentication.AuthenticationException, and this System.Net.Security.SslStream is no longer useable. You should close this object and remove all references to it so that it can be collected by the garbage collector.

To perform this operation synchronously, use one of the erload:System.Net.Security.SslStream.AuthenticateAsServer methods.

Requirements

Namespace: System.Net.Security
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0