I was playing around with .NET Core and building an API that utilizes payment APIs. There's a client certificate that needs to be added to the request for two-way SSL authentication.
How can I achieve this in .NET Core using HttpClient
?
I have looked at various articles and found that HttpClientHandler
doesn't provide any option to add client certificates.
Best Answer
I ran a fresh install for my platform (Linux Mint 17.3) following these steps: .NET Tutorial - Hello World in 5 minutes. I created a new console application targeting the
netcoreapp1.0
framework, was able to submit a client certificate; however, I did receive "SSL connect error" (CURLE_SSL_CONNECT_ERROR 35
) while testing, even though I used a valid certificate. My error could be specific to my libcurl.I ran the exact same thing on Windows 7 and it worked exactly as needed.