473,769 Members | 6,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client Certificates: The request failed with HTTP status 403: Forbidden.

Using C# .Net V 1.1.4322, I am attempting to call some web services
that will ONLY be consumed by our Winforms client application.

I have my web service security working from the browser by following
instructions from good resources like this:
http://www.windowsecurity.com/articl...te-Authenticat...
I cannot successfully call the same web service from my C#
application.
I am attempting to embed my client certificate in the code so that
only my software will have the certificate. I have done this by
adding the CA cert file to the project and tagging it as an embedded
resource. I then have this method:
private static X509Certificate wsCertificate;
private static X509Certificate GetCertificate( )
{
if(wsCertificat e != null)
{
return wsCertificate;
}
Assembly a = Assembly.GetExe cutingAssembly( );
byte[] certBytes = null;
using(Stream certStream =
a.GetManifestRe sourceStream("D ataAccess.Posti nkClient.cer"))
{
certBytes = new byte[certStream.Leng th];
certStream.Read (certBytes, 0,
Convert.ToInt32 (certStream.Len gth));
}
wsCertificate = new X509Certificate (certBytes);
return wsCertificate;

}
This method gets called during configuration of my web service:

ws.ClientCertif icates.Add(GetC ertificate());
The resulting error is as follows:
The request failed with HTTP status 403: Forbidden.
Since the I can call this from the browser, I assume my server config
is ok. It has to something with how I'm dealing with the certificate
in the code.
Does anyone have any ideas? Keep in mind that I would really like
for
my application to handle this seamlessly as I deploy without having
to
install certificates on each machine it will be running on.
Or is there a much better way??????
Thanks in advance for any help or advice you can provide.
Karl

Jun 26 '07 #1
0 2642

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11328
by: Matt Frame | last post by:
I am working on a special ASP.Net application that receives files from customers. The connection is made via HTTPS and the client sends the file as a POST to my ASP.Net listener. All of this works fine. Now I am looking at how to validate the clients certificate programmatically. The client application sends to me with something like: .... Dim myHttp As HttpWebRequest = CType(WebRequest.Create(https://myserver/Receive.aspx),...
3
2820
by: Tim Burris | last post by:
At the top here i will put a quick description of my problem followed by the long description. This way you want get bored reading! : short version what is the best/recommended way for ASPNET apps to call web services that REQUIRE Client Certificates via SSL long version our company has new requirements, all servers must REQUIRE SSL and Server/client certificates i have setup a test Win2003 server to issue certs so i have a full test...
0
1783
by: Russ | last post by:
I have set up a C# web application that runs on my test Web Server (Windows 2003 Server, Web Edition). It in turn calls a web service running on the internal network. Now I want to issue a client certificate to each client connecting to the web app, and use it to authenticate and identify the clients on the web server (and use the SSL for secure encrypted exchanges). There is no issue requiring SSL between the web server and the back...
1
3907
by: Deepak | last post by:
We retrieve data from a company called XYZ through httpwebrequest. The program is coded using VB.NET They have given a certificate to install. This certificate is included with the request object.I use httpwebrequest to retrieve data. The certificate is added to the client certificates collection. When this component is called from a windows application, I can retrieve the data. When this component is called from a web page, I get the...
2
5687
by: edsuslen | last post by:
I am migrating working code (HTTPRequest with Authentication) from vb to vb.net vb: Set objXMLHTTPServer = New MSXML2.XMLHTTP30 objXMLHTTPServer.Open strMethod, strGetRequest, False, "UserId", "Password" objXMLHTTPServer.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" ....
0
3377
by: Koan B | last post by:
(Cross-posted to dotnet.framework.aspnet.webservices and dotnet.framework.webservices, follow-ups set to dotnet.framework.aspnet.webservices) Hi, I'm attempting to connect to a 3rd party web service (for which they have supplied client certificates), but with no success. As far as I can tell, the code below should work, however, I always
14
10018
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code> function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) {
1
1613
by: =?Utf-8?B?VGFwaW8gTGluZHF2aXN0?= | last post by:
I have a problem with .NET COM+ component which cannot access the private key of the client certificate. The problem seems to be that when the user on which privileges the COM+ server application is running is logged in, the certificate can be accessed. But as soon as the user logs out the I get forbidden errors on the server. I've tried to put the certificate in the users personal store and in the local machine personal store and...
3
12487
by: mzarlenga | last post by:
I have a client / server written in C#/VS2005 that uses WCF. Each component exposes a secure (https:) endpoint with WCF. httpcfg was used to secure the ports with certificates. (Both system use the same certificate for their endpoints, in case that matters) The client and server are on different physical systems. The applications communicate like so: Request: Client -----Server's endpoint ( https://172.16.26.30:8283/MyServer )
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.