Error when using client certificate on .NET Core 2.0
I need to connect with REST API using client certificate. I was able to do that on .NET Core 1.0, but now when I've migrated to .NET Core 2.0 I'm getting this error:
The handler does not support client authentication certificates with this combination of libcurl (7.51.0) and its SSL backend ("NSS/3.28.4") Module "System.Net.Http.CurlHandler+SslProvider", line 28, col 0, in SetSslOptionsForUnsupportedBackend Void SetSslOptionsForUnsupportedBackend(EasyRequest, ClientCertificateProvider) Module "System.Net.Http.CurlHandler+SslProvider", line 196, col 0, in SetSslOptions Void SetSslOptions(EasyRequest, System.Net.Http.ClientCertificateOption) Module "System.Net.Http.CurlHandler+EasyRequest", line 208, col 0, in InitializeCurl
Code is deployed on Unix environment (AWS Lambda). I've posted this issue here as well: https://github.com/aws/aws-lambda-dotnet/issues/221
This looks related to https://github.com/dotnet/corefx/issues/24232
Using client certificates on Linux in .NET Core <= 2.0 requires a libcurl built against OpenSSL. The error is saying the libcurl being used is built against NSS instead.
@stephentoub What is solution then?
What is solution then?
For .NET Core 2.0 and earlier, using a libcurl built against OpenSSL, e.g. one installed from a package manager if available, one built from source, etc. HttpClient on .NET Core 2.0 and earlier on Unix is built on libcurl, and to enable client certificates, the features we need are only available when using libcurl with an OpenSSL backend, because System.Security.Cryptography.X509Certificates uses OpenSSL. In .NET Core 2.1, we plan to have an implementation that doesn't require libcurl.
That's good. Do we have an ETA for .NET Core 2.1 public release? BTW, this problem is particular hard to solve for Lambda functions running in AWS as we are also depending on AWS to support the latest version of .NET Core. Historically AWS takes a while to enable support for the latest version of .NET Core.
Here's official .NET Core 2.1 roadmap: https://github.com/dotnet/core/blob/master/roadmap.md#upcoming-ship-dates (more details are not published yet)
The question seems to be answered. .NET Core 2.1 will support a new default HTTP stack (SocketsHttpHandler) that won't have this restriction regarding the use of client TLS/SSL certificates.