473,739 Members | 6,186 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

Hi,
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,
MY_ENCODING_TYP E,0, CERT_FIND_SUBJE CT_STR,

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?
Thanks
Joey

Nov 17 '05 #1
0 2431

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

Similar topics

3
2818
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...
6
2416
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
2
2222
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!
6
17074
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 secured I get this error: The underlying connection was closed: Could not establish trust...
7
4362
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. a) Do you still need ODP.NET with framework 2.0? b) Do you need to download and install other...
2
4257
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 SSL to "require client certificate" I am prompted for a client cert when I initially open the url....
4
1489
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
0
2558
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 and service side: <bindings> <basicHttpBinding>
3
2489
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";
0
8969
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
8794
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9483
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...
1
9269
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9211
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
8216
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
6056
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
4572
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3282
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.