473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HttpClientCertificate not available in webservice

Hi

We have developed a webservice that was accessed by a fat windows client. A
security requirement was that the client authenticates itself by using by
providing a client certificate. The webserver (iis) made then sure that only
clients providing a valid certificate could connect. (settings: Requeire
secure channel, Require client certificates). This worked fine.

Due to a request by our client, we are forced to integrate the webservice in
another website where iis does not requeire a client certificate. I thought
about moving this security check to the application by checking the
HttpContext.Current.Request.ClientCertificate property. Unfortunately, this
does not work as i wish. When i debug, the ClientSertificate.IsPresent
property is always set to false. How is this possible, our client does send
a certificate.

Some more information about our settings:

- in iis we use security settings are set to accept client certificates!
- the certificates we use are invalid !!! Is it possible that iis blocks
this certificates so the webserver does not see them?

I am grateful for any help. Thanks in advance

Greetings
Daniel
--------------------------------------- Client code connection to webservice
and adding certificate to
est ------------------------------------------

private void InitWebService(string URL) {

webService = new Service();

webService.Url = URL;

cookies = new System.Net.CookieContainer();

webService.CookieContainer = cookies; // now Session are no longer lost

// create an X509Certificate object from the information

// in the certificate export file and add it to the

// ClientCertificates collection of the Web service proxy

ResourceManager resourceManager = new
ResourceManager("SmartClient.Certificate.ClientCer tificate",
Assembly.GetExecutingAssembly());

object o = resourceManager.GetObject("prime_user_cert_29jun20 06"); //
certificate testcertificate would be clientcert

Byte[] bytesOfCertificate = null;

if (o is System.Byte[]) {

bytesOfCertificate = (System.Byte[])o;

}

X509Certificate cert = new X509Certificate(bytesOfCertificate);

webService.ClientCertificates.Add(cert);

}

------------------------------------------------- Server
code ---------------------------------------------------

internal bool ValidateClient(){

HttpClientCertificate certificate =
HttpContext.Current.Request.ClientCertificate;

if(certificate == null || !certificate.IsPresent ){

return false;

}else{

return certificate.IsValid;

}

}

Mar 13 '07 #1
0 1998

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

Similar topics

1
by: SRK_at_ISD | last post by:
While in a function of my web service that was called from another application (not a web page), I get the an error when calling the function "Context.Request.UserHostAddress()": Unhandled...
4
by: George Jordanov Ivanov | last post by:
Folks, When you access your XML Web Service in IE for example (using HTTP), you get the familiar to all of us page: The following operations are supported. For a formal definition, please...
13
by: Edje.Rommel | last post by:
Hello, I've have a problem with a webservice. I just want to validate a VAT number by country code and VAT numer. The return value should be like "it's valid" and/or the name where it's...
6
by: axel22 | last post by:
I've made a web service in c# and published it with IIS. I can access it's methods locally, but when a colleague tried to access the Web Service over the Internet using my IP address, he...
0
by: Chuck | last post by:
I have a webservice that I created and I am using it througout my asp.net 2.0 web application. It is being called via javascript using ATLAS. I am now trying to add a webservice that should be...
2
by: ko | last post by:
Quote (http://msdn2.microsoft.com/en-us/library/ system.web.httpclientcertificate.cookie.aspx): "can be used as a signature for the whole client certificate" Does anyone know how the signature...
7
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
4
by: =?Utf-8?B?ZmFpcnl2b2ljZQ==?= | last post by:
Hi, i create an asp.net webservice, then reference this webservice in another project in the same machine, it works well when using "localhost" to locate the webservice but fails when using the ip...
2
by: Mike Endys | last post by:
Hi all, have problem to use login to the web service. Im thinking about the web service that provides datas and files to the WinForm Client. I want the client log-in to the application... here...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.