Bug 3969 - HttpListenerRequest does not implement GetClientCertificate
Summary: HttpListenerRequest does not implement GetClientCertificate
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Gonzalo Paniagua Javier
URL:
Depends on:
Blocks:
 
Reported: 2012-03-19 12:13 UTC by David Ferguson
Modified: 2012-05-01 15:20 UTC (History)
3 users (show)

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


Attachments
Implements the HttpListenerRequest.GetClientCertificate (2.86 KB, patch)
2012-03-19 12:13 UTC, David Ferguson
Details
Alternative patch (untested) (6.66 KB, patch)
2012-03-21 14:38 UTC, Gonzalo Paniagua Javier
Details


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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description David Ferguson 2012-03-19 12:13:50 UTC
Created attachment 1539 [details]
Implements the HttpListenerRequest.GetClientCertificate

HttpListenerRequest.GetClientCertificate always returns null.  Attached is a patch that adds support for HttpListenerRequest.GetClientCertificate.

As part of this, the HttpConnection implements a delegate for validating client certificates.  In order for client certificates to be used, this delegate returns true.  Currently, the validation code examines the certificate properties to determine if the certificate can be used by a server.
Comment 1 Gonzalo Paniagua Javier 2012-03-21 14:38:43 UTC
Created attachment 1551 [details]
Alternative patch (untested)

This is an alternative implementation that checks for validation errors too.

It also removes writing the DN of all the certs in the trust store upon client connection.
Comment 2 David Ferguson 2012-03-21 14:53:57 UTC
I'll test this shortly and post results.
Comment 3 Sebastien Pouliot 2012-03-26 15:28:42 UTC
Gonzalo, I don't have an issue with not sending the DN - but make it a separate commit (just in case we have to re-enable it ;-)
Comment 4 Gonzalo Paniagua Javier 2012-03-26 16:12:11 UTC
Ok. I will apply that patch separately.

David, how's that testing going?
Comment 5 David Ferguson 2012-03-26 16:15:38 UTC
I'm currently in a major refactoring effort of an extremely important piece of code that is causing me not to be able to test the http infrastructure.  I predict being able to run through it tomorrow morning.
Comment 6 David Ferguson 2012-04-30 15:11:03 UTC
According to my coworker, this is working.  I'm in the process of creating our own fork of the mono tree and I'll apply this to our development branch instead of the temporary ones I had.  I'll update this as soon as I confirm it is fixed.
Comment 7 Gonzalo Paniagua Javier 2012-04-30 15:27:42 UTC
Hah. Sweet. *RIGHT NOW* I was starting to build a test setup for this issue and do it myself. If it works fine, I will push it to master and, may be, mono-2-10.

Let us know how your test goes.

Thanks!
Comment 8 Gonzalo Paniagua Javier 2012-04-30 17:38:36 UTC
Fixed in master/05f25ea
I'll close the  bug once I merge this onto mono-2-10
Comment 9 Gonzalo Paniagua Javier 2012-05-01 15:20:15 UTC
master also needs 9da7c4b8fda988948107efe421fdabc2a7e22dd4 to complete the previous patch.

mono-2-10/906ca96d65f715b11947385a435dfed05d9d4494 and
mono-2-10/80801f6d22ffb03982a63dbed786afadac7e685b fix the problem in that branch