SslStream.AuthenticateAsServer Method (X509Certificate, Boolean, SslProtocols, Boolean)
Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificates, requirements and security protocol.
Assembly: System (in System.dll)
public virtual void AuthenticateAsServer( X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation )
The X509Certificate used to authenticate the server.
A Boolean value that specifies whether the client is asked for a certificate for authentication. Note that this is only a request -- if no certificate is provided, the server still accepts the connection request.
The SslProtocols value that represents the protocol used for authentication.
serverCertificate is null.
enabledSslProtocols is not a valid SslProtocols value.
The authentication failed and left this object in an unusable state.
Authentication has already occurred.
Client authentication using this SslStream was tried previously.
Authentication is already in progress.
This object has been closed.
The AuthenticateAsServer method is not supported on Windows 95, Windows 98, or Windows Millennium.
This method blocks until the operation completes. To prevent blocking until the operation completes, use one of the BeginAuthenticateAsServer method overloads.
If the authentication fails, you receive a AuthenticationException, and this 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.
The AuthenticateAsServer method is not supported.
Available since 2.0