Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Asp.net Core and OpenSSL running on Mac OS

$
0
0

I have an Asp.NET Core web site which is making a make a HTTP POST request to an SSL endpoint that requires a SSL certificate.  It works fine when running in a Windows 10 environment, but on the Mac OS, there is a OpenSSL exception which reads as follows:

One or more errors occurred. (The libcurl library in use (7.43.0) and its SSL backend ("SecureTransport") do not support custom handling of certificates. A libcurl built with OpenSSL is required.)

Here is my Asp.Net Core C# controller code snippet.

HttpClientHandler handler = new HttpClientHandler();

handler.SslProtocols = System.Security.Authentication.SslProtocols.Tls12;
string certFileName = _hostingEnvironment.ContentRootPath + "/Resources/the-certificate-file.p12";
string certFilePassword = "thepasswordforthep12filegoeshere";
X509Certificate2 certificate = new X509Certificate2(certFileName, certFilePassword);
handler.ClientCertificates.Add(certificate);

using (var client = new HttpClient(handler))
{

  ...perform the HTTP POST asyncronously...


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>