Method
AuthenticateAsClient
func AuthenticateAsClient(options: SslClientAuthenticationOptions, targetHost: string, cancellationToken: CancellationToken = default) -> Task<Result<void, SslError>>
Declaring type: SslStream
Module: System.Networking.Security
Assembly: System.Networking.dll
Source file: SslStream.rvn
Authenticates the server using explicit trust and the expected DNS name (also used for SNI). Cancellation before entry preserves state; cancellation after starting aborts the session.
Parameters
| Name | Type | Description |
|---|---|---|
options |
SslClientAuthenticationOptions | |
targetHost |
String | |
cancellationToken |
CancellationToken |