Skip to content

ITlsConnectionFeature.GetRemoteCertificateAsync(CancellationToken)

GetRemoteCertificateAsync(CancellationToken)

abstract
public abstract Task<X509Certificate2?> GetRemoteCertificateAsync(CancellationToken cancellationToken)
Asynchronously retrieves the remote endpoint's certificate, if any.

Parameters

cancellationTokenCancellationToken
The cancellation token associated with the request.

Returns

A task which returns the remote endpoint's certificate, or null if none is available.