public async Task<X509Certificate2> GetCertificateAsync()
{
using (var client = GetClient())
{
HttpResponseMessage response = await client.PostAsJsonAsync("api/server/cert", _certificateCache);
if (response.IsSuccessStatusCode)
{
var result = (X509Certificate2)await response.Content.ReadAsAsync(typeof(X509Certificate2));
return result;
}
return null;
}
}