ASP.NET / certificat

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


Date: Wed, 26 Jan 2005 05:25:01 -0800

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: IIS Start up errors
    ... provide the detailed steps to reinstall the IIS server in SBS 2003 server. ... For example, programs such as Microsoft ... In the Currently installed programs list, click Windows Small Business ...
    (microsoft.public.windows.server.sbs)
  • Re: Active Directory Services cannot find the web server
    ... I am having the same problem with a windows xp pro with iis 5.1 ... incedently does not work properly when connecting to the server. ... both the client and server and still no luck. ...
    (microsoft.public.dotnet.faqs)
  • Re: restated: VS Develper (non Admin) missing IIS MMC Management
    ... > debug ASP in VB.Net, and of course manage IIS MMC. ... > Microsoft Development Environment ... > Information Server on the client and the server. ... > server from a Windows NT 4.0 client. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: restated: VS Develper (non Admin) missing IIS MMC Management
    ... > debug ASP in VB.Net, and of course manage IIS MMC. ... > Microsoft Development Environment ... > Information Server on the client and the server. ... > server from a Windows NT 4.0 client. ...
    (microsoft.public.dotnet.general)
  • Re: restated: VS Develper (non Admin) missing IIS MMC Management
    ... > debug ASP in VB.Net, and of course manage IIS MMC. ... > Microsoft Development Environment ... > Information Server on the client and the server. ... > server from a Windows NT 4.0 client. ...
    (microsoft.public.inetserver.iis)