Last post Aug 19, 2016 06:06 AM by evermeire
Aug 17, 2016 10:06 PM|evermeire|LINK
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);
using (var client = new HttpClient(handler))
...perform the HTTP POST asyncronously...
Aug 17, 2016 10:57 PM|Radomir|LINK
EDIT: Better link is:
Aug 18, 2016 10:50 PM|evermeire|LINK
I tried all of those solutions, nothing works.
Aug 18, 2016 11:31 PM|Radomir|LINK
What does curl --version show you? Did you do the export of that variable?
Aug 19, 2016 05:47 AM|evermeire|LINK
$ curl --version
curl 7.50.1 (x86_64-apple-darwin15.6.0) libcurl/7.50.1 OpenSSL/1.0.2h zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
Before I followed the suggestions, my default curl version was 7.43, so the steps I performed did upgrade curl, but Asp.Net Core still
I am not sure if there is another step I need to perform in order to tell Asp.NET Core to use a different version of curl.
Aug 19, 2016 06:06 AM|evermeire|LINK
When I set the environment variable via VS Code launch.json file, I then see the following exception upon debug run.
Starting: "/Users/ericv/.vscode/extensions/ms-vscode.csharp-1.3.0/coreclr-debug/debugAdapters/clrdbg" --interpreter=mi
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Expected in: /usr/local/lib//libJPEG.dylib
"/Users/ericv/.vscode/extensions/ms-vscode.csharp-1.3.0/coreclr-debug/debugAdapters/clrdbg" exited with code 133 (0x85).