I am trying to make a post request from a https to another https. I have ordered and installed a certificate with private key, and the certificate is installed in Personal and Trusted Root Certification Authorities for both Current User and Local Computer.
I have googled, read and tried many solutions from The request was aborted: Could not create SSL/TLS secure channel and other websites. Nothing is working for me. I'm always getting "The request was aborted: Could not create SSL/TLS secure channel"
I am using .Net Framework 4.7.1, and my code is the following
public async Task<HttpResponseMessage> PostAsync<T>(T arg, string uri)
{
var handler = new WebRequestHandler();
var client = new HttpClient(handler);
try
{
var content = CreateJsonContent(arg);
var processResult = await client.PostAsync(uri, content);
return processResult;
}
catch (Exception exception)
{
throw;
}
finally
{
client.Dispose();
}
}
All help is highly appreciated