ASP.NET / certificat
From: Jerome (Jerome_at_discussions.microsoft.com)
Date: 01/26/05
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Previous message: mikemad: "Forms Authentication and requireSSL, what's the recommended best practice"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Previous message: mikemad: "Forms Authentication and requireSSL, what's the recommended best practice"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: ASP.NET / certificat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|