System.Net.Security.SslStream.AuthenticateAsServer Method

Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificate.

Syntax

public virtual void AuthenticateAsServer (System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate)

Parameters

serverCertificate
The certificate used to authenticate the server.

Remarks

This method authenticates using System.Security.Authentication.SslProtocols.Default. The certificate revocation list is not checked during authentication. The client is not required to provide a certificate for authentication.

This method blocks until the operation completes. To prevent blocking until the operation completes, use one of the erload:System.Net.Security.SslStream.BeginAuthenticateAsServer method overloads.

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.

Requirements

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