Bug 23075 - Not implemented WebRequestHandler.ClientCertificates makes it impossible to use custom SSL certs for HTTP requests on Mono
Summary: Not implemented WebRequestHandler.ClientCertificates makes it impossible to u...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: General ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-09-16 20:26 UTC by Ahmet Alp Balkan
Modified: 2015-11-18 02:11 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 23075 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Ahmet Alp Balkan 2014-09-16 20:26:14 UTC
I'm using [Microsoft HTTP Client Libraries](https://www.nuget.org/packages/Microsoft.Net.Http) from NuGet and I'm basically trying to allow TLS authentication in HttpClient using X509Certificate2 certificates.

I have tried creating the client like this:

	WebRequestHandler certHandler = new WebRequestHandler () {
		ClientCertificateOptions = ClientCertificateOption.Manual,
		UseDefaultCredentials = false
	certHandler.ClientCertificates.Add (this.ClientCertificate);
	HttpClient client = new HttpClient (certHandler);

However `certHandler.ClientCertificates` is failing because this getter is not implemented in Mono:


This unimplemented part of the class makes it impossible to use custom client certificates in HTTP requests on Mono environment. This actually matters because some SDKs like

* Microsoft Azure Management Libraries for .NET https://www.nuget.org/packages/microsoft.windowsazure.management.libraries
* Amazon Web Services SDK for .NET http://aws.amazon.com/sdk-for-net/ [1]

uses customer-provided certificates to authenticate to the APIs. Therefore, custom SSL certificate handling is becoming more popular and it would be getter if that missing portion gets implemented.

(I also asked this as a StackOverflow question here: http://stackoverflow.com/questions/25495056/using-custom-ssl-client-certificates-system-net-httpclient-on-mono)

[1]: Similar bug #17768