16 public readonly Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool>
FromHttpClientHandler;
20 public CertificateCallbackMapper(Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> fromHttpClientHandler)
30 if (remoteCertificateValidationCallback !=
null && remoteCertificateValidationCallback.Target is
CertificateCallbackMapper certificateCallbackMapper)
32 sslOptions = sslOptions.ShallowClone();
33 Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> localFromHttpClientHandler = certificateCallbackMapper.FromHttpClientHandler;
37 bool result = localFromHttpClientHandler(localRequest, certificate as
X509Certificate2, chain, sslPolicyErrors);
87 [SupportedOSPlatform(
"windows")]
88 [SupportedOSPlatform(
"linux")]
89 [SupportedOSPlatform(
"macos")]
static bool ShouldWrapInOperationCanceledException(Exception exception, CancellationToken cancellationToken)
static Exception CreateOperationCanceledException(Exception innerException, CancellationToken cancellationToken)
CertificateCallbackMapper(Func< HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool > fromHttpClientHandler)
readonly Func< HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool > FromHttpClientHandler
readonly RemoteCertificateValidationCallback ForSocketsHttpHandler
static Exception CreateWrappedException(Exception error, string host, int port, CancellationToken cancellationToken)
static SslClientAuthenticationOptions SetUpRemoteCertificateValidationCallback(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request)
static async ValueTask< SslStream > EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, bool async, Stream stream, CancellationToken cancellationToken)
static async ValueTask< QuicConnection > ConnectQuicAsync(HttpRequestMessage request, QuicImplementationProvider quicImplementationProvider, DnsEndPoint endPoint, SslClientAuthenticationOptions clientAuthenticationOptions, CancellationToken cancellationToken)
ValueTask ConnectAsync(CancellationToken cancellationToken=default(CancellationToken))
RemoteCertificateValidationCallback? RemoteCertificateValidationCallback
override void Dispose(bool disposing)
virtual Task AuthenticateAsClientAsync(string targetHost)
virtual void AuthenticateAsClient(string targetHost)
static string net_http_ssl_connection_failed
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)