Programmatically Asking for Client Certificate

Discussion in 'ASP .Net Web Services' started by Someone Beneath the Blue Sky, Feb 12, 2004.

  1. Hello All,

    I have written a web service. I've added the following code to the
    global.asax.cs

    protected void Application_BeginRequest(Object sender, EventArgs e)
    {
    if ( !Request.IsSecureConnection )
    {
    Response.Redirect(
    Request.Url.ToString().Replace( "http:", "https:" ) );
    return;
    }
    }

    It forces the clients to connect to my web service only through SSL.

    Now I want to force them to supply a client certificate with their
    https request (the corresponding flag on IIS is set to not to require
    client certificate). How can I do that through dotnet (for example
    changing some flag in Requesnt object) ? I know how we can do this
    when using wininet, but don't know how to do that in dotnet.

    Also I want to set the Common Name of the client certificate in the
    server response, so that in case of multiple client certificates if
    doesn't ask the client to choose which certificate to use. Is there
    any way to do this ?

    Any help would be appreciated.
     
    Someone Beneath the Blue Sky, Feb 12, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zorba
    Replies:
    0
    Views:
    1,128
    Zorba
    Jun 4, 2004
  2. Luca Caruso

    client certificate

    Luca Caruso, Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    572
    Luca Caruso
    Jul 15, 2003
  3. Subra Mallampalli
    Replies:
    0
    Views:
    571
    Subra Mallampalli
    Oct 2, 2003
  4. Joe Wong
    Replies:
    2
    Views:
    4,328
  5. david wolf
    Replies:
    0
    Views:
    433
    david wolf
    Aug 22, 2006
  6. Mfenetre
    Replies:
    11
    Views:
    2,246
    Joe Kaplan \(MVP - ADSI\)
    Oct 12, 2005
  7. Helena Cai
    Replies:
    0
    Views:
    688
    Helena Cai
    Aug 29, 2004
  8. Replies:
    0
    Views:
    719
Loading...