Re: ASP.NET / certificat

From: Jerome (Jerome_at_discussions.microsoft.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 01:51:02 -0800

Thanks for your answer

Yes, the client certificat is install in user's certificate store
(mmc -> Certificates (local computer) -> Personal -> Certificates)
Everthing works fine when I use a .NET Windows form application

a another idea?

"Joe Kaplan (MVP - ADSI)" wrote:

> This sounds like the standard problem of not being able to access the
> private key for the certificate from the current process. This is probably
> a result of it being installed in the user's certificate store. Have you
> tried installing it in the machine store?
>
> Joe K.
>
> "Jerome" <Jerome@discussions.microsoft.com> wrote in message
> news:D0E2FEEA-7724-4A29-B4D9-6186232DD8FE@microsoft.com...
> > Hi all
> >
> > I'm trying to access to a virtual directory (web server is a IIS 6.0 on
> > Windows 2003 server) which requires client
> > certificate with HttpWebRequest class.
> > Simplified function code looks like this:
> >
> > HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
> > httpWebRequest.ClientCertificates.Add(X509Certificate.CreateFromCertFile(@"c:\dada.cer"));
> > httpWebRequest.Method = "POST";
> > httpWebRequest.ContentLength = requestData.Length;
> > Stream streamWriter = (httpWebRequest.GetRequestStream());
> > streamWriter.Write(requestData,0,requestData.Length);
> > streamWriter.Flush();
> > streamWriter.Close();
> > HttpWebResponse httpWebResponse =
> > (HttpWebResponse)httpWebRequest.GetResponse();
> > StreamReader streamReader = new
> > StreamReader(httpWebResponse.GetResponseStream());
> >
> > When I tried this function in .NET Windows form
> > application (C#) it works OK. But if I try to call the same
> > function inside .NET ASP application (IIS 5.1 on Windows XP pro) I get
> > Exception "The
> > remote server returned an error: (403) Forbidden." when I trying to get
> > response
> > (line: HttpWebResponse httpWebResponse =
> > (HttpWebResponse)httpWebRequest.GetResponse();)
> >
> > How can I do to configure my environment to allow ASP.NET application
> > access
> > my virtual directory
> > Thanks,
> > Jerome
>
>
>



Relevant Pages

  • Re: Suppressing security dialogs when app opens
    ... "Adding the above two keys to the install makes the runtime install ... I'm not comfortable altering the security mechanism of a machine without the user's knowledge ... ... Because a digital certificate you create yourself isn't issued by a formal certification authority, ... Microsoft Office will only trust a self-signed certificate on a computer that has the private key for that certificate ...
    (comp.databases.ms-access)
  • Re: Windows Update repeats
    ... You cannot install some updates or programs ... to a Windows component, install a service pack for Windows or for a Windows ... The Microsoft digital signature affirms that software has been tested with ... Publishers certificate store. ...
    (microsoft.public.windowsupdate)
  • RE: updates after format
    ... if the Microsoft Server is down. ... software you are installing has not passed Windows Logo testing verify its ... When you try to download an ActiveX control, install an update to Windows ... and you do not have the appropriate certificate in your Trusted Publishers ...
    (microsoft.public.windows.mediacenter)
  • Re: ?Expired Security Certif for MS Update
    ... MBSA should run fine on a new install. ... faith in the downloads I have, that used the expired certificate to get ... At the risk of sounding like an alien abductee, this security invasion ... Microsoft and signed by a CA that your computer trusts I would not worry ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Certificates on Floppy Disk?
    ... > give you the option to install this certificate which you want to do. ... > unselect enable strong protection as user will have to enter private key ... > personal folder for the computer store and select import and then browse ...
    (microsoft.public.windows.server.security)