Called by clients to authenticate the server and optionally the client in a client-server connection. The authentication process uses the specified certificate collection and SSL protocol.
- targetHost
- The name of the server that will share this System.Net.Security.SslStream.
- clientCertificates
- The System.Security.Cryptography.X509Certificates.X509CertificateCollection that contains client certificates.
- enabledSslProtocols
- The System.Security.Authentication.SslProtocols value that represents the protocol used for authentication.
- checkCertificateRevocation
- A bool value that specifies whether the certificate revocation list is checked during authentication.
When 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.
Client certificates are not supported in the SSL version 2 protocol.