473,544 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# fails to connect to IIS Web Service if we require both Client Certificate and Username/Password

We are trying to add a Client Certificate support for our web app that
emulates a hardware device web app.

The hardware uses a 2 factors authentication, which requires a Web
Service client to send: Client Certificate and Username / password.

We are using a Web Service provider which uses IIS 5.1 as HTTP server.
IIS is set to require client certificate and Basic Authentication.

Basically the client does:

System.Net.Cred entialCache cache = new System.Net.Cred entialCache();

cache.Add( new Uri(service.Url ), "Basic", new
System.Net.Netw orkCredential(u sername, userpass));

service.Credent ials = cache;


hCertCntxt=WinC api.CertFindCer tificateInStore (hSysStore,

lpszCertSubject , IntPtr.Zero) ;

X509Certificate foundcert = new X509Certificate (hCertCntxt);

service.ClientC ertificates.Add (foundcert);

-Our problem

The execution of the Web Service client fails on timeout.

If we change the IIS setting to require client certificate without
Basic Authentication and with anonymous access it works fine.

If we change the IIS setting to require Basic Authentication but
without client certificate it works fine.

The same the Web Service client works fine with another implementation
of the Web Server which uses Allegro as its HTTP server. And IIS works
fine with a test app written in c++ using gSOAP

My Question

What do we need to do to make the C# client work with the IIS?

Nov 17 '05 #1
0 2413

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

Similar topics

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...
by: John | last post by:
Hi How can I make sure that no one else can call and receive data from my web methods? Thanks Regards
by: Naeem Sarfraz | last post by:
Any advice for the following situation? I've deployed my webservice on a remote server, e.g. http://mywebservice.co.uk/summary.asmx. The windows clients attempts to access this webservice and fails, the error returned is "there was an error processing the <Security> header". If I run the client on the server there is no problem. Help!
by: Kenneth Moss | last post by:
I have a web service I am calling which I made. I am consuming this service from another domain (and I've tried from a windows app also). I added a certificate to the web service so it will use ssl. I made a web reference to the unsecured and secured version of the web service. When connecting unsecured, it works fine. When I connect...
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work. I tried that quickly, but the file is 400 MB, and the the installation asks for all kinds of things in order to install. Now I'm very confused....
by: =?Utf-8?B?Sm9obiBC?= | last post by:
A windows forms 2.0 ClickOnce deployment fails when both SSL is enabled and "require client certificate" enabled on the IIS deployment web server. Can anyone assist with how to configure this properly or at least confirm if it will just not work? When not requiring the client certificate the deployment site works fine. However, when I set...
by: =?Utf-8?B?Qm9i?= | last post by:
I have a 1.1 framework VB.NET web service that is being called my multiple clients. How can I determine the name of the client app that is calling the web service at runtime from the web method? Thanks
by: =?Utf-8?B?RVNQTlNUSQ==?= | last post by:
Hi, I'm working on a Web application that consumes a WCF Service that uses basic HTTP binding with transport security and certificates for client credentials. Just to clarify, the WebServer (IIS 7) is the client, and an application that self hosts the WCF service is the server. This is the binding configuration that I use on the client...
by: Anil S | last post by:
Hello, my application is console application and I have created "Service Reference" of the webservices. this webservice uses username and password. my code are following: myArray nl; FeedSoapClient client = new FeedSoapClient(); client.ClientCredentials.UserName.UserName = "tellme"; client.ClientCredentials.UserName.Password = "tellme";
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...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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...
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...
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...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.