[Mono-list] ssl client authentication

Sébastien Pouliot spouliot@videotron.ca
Thu, 31 Mar 2005 12:35:46 -0500


Hello Nelson,

The HttpClientCertificate class isn't implemented in Mono (it's only
stubbed). It shouldn't be difficult to implement from the server variables.

Of course it's more complicated if the server variables don't include them.
Gonzalo may know why they are missing (and how to add them ;-).

Sebastien Pouliot
home: spouliot@videotron.ca
blog: http://pages.infinit.net/ctech/poupou.html


> -----Original Message-----
> From: mono-list-admin@lists.ximian.com
> [mailto:mono-list-admin@lists.ximian.com]On Behalf Of nelson
> Sent: 31 mars 2005 11:53
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] ssl client authentication
>
>
> Hi,
> I setup an apache (2.0.53) with mod_mono (1.0.6) and mono (1.1.5) and
> configure a directory to request a Certificate over SSL. That work ok.
> When generate a page with this code [1], the page don't shown the
> certificate data for the session, and when add this code [2], show all
> the certificate variables, but the CERT_XXX variables are empty.
> I want to verify the certificate credentials against a db and permit
> access to diferent options, but can't access the certificate data :(.
> Is something i'm doint wrong ?...
>
> [1]
> http://support.microsoft.com/kb/315588/EN-US/
> ---8<-------------------------------------------------------------
> -------------------
> void Page_Load(xxxx)
> {
> string userName;
> userName = User.Identity.Name;
> greetingLabel.Text = "Welcome " + userName;
> HttpClientCertificate cert = Request.ClientCertificate;
> if (cert.IsPresent)
>     certDataLabel.Text = cert.Get("SUBJECT O");
> else
>     certDataLabel.Text="No certificate was found.";
> }
> ---8<-------------------------------------------------------------
> -------------------
>
>
> [2]
> ---8<-------------------------------------------------------------
> -------------------
> int loop1, loop2;
> NameValueCollection coll;
>
> // Load ServerVariable collection into NameValueCollection object.
> coll=Request.ServerVariables;
> // Get names of all keys into a string array.
> String[] arr1 = coll.AllKeys;
> for (loop1 = 0; loop1 < arr1.Length; loop1++)
> {
>    Response.Write("Key: " + arr1[loop1] + "<br>");
>    String[] arr2=coll.GetValues(arr1[loop1]);
>    for (loop2 = 0; loop2 < arr2.Length; loop2++) {
>       Response.Write("Value " + loop2 + ": " +
> Server.HtmlEncode(arr2[loop2]) + "<br>");
>    }
> }
> ---8<-------------------------------------------------------------
> -------------------
>
> TIA
> --
> :: Nelson ::
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list