468,537 Members | 1,949 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

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.CredentialCache cache = new System.Net.CredentialCache();

cache.Add( new Uri(service.Url), "Basic", new
System.Net.NetworkCredential(username, userpass));

service.Credentials = cache;

....

hCertCntxt=WinCapi.CertFindCertificateInStore(hSys Store,
MY_ENCODING_TYPE,0, CERT_FIND_SUBJECT_STR,

lpszCertSubject , IntPtr.Zero) ;

X509Certificate foundcert = new X509Certificate(hCertCntxt);

service.ClientCertificates.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 2183

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tim Burris | last post: by
6 posts views Thread by John | last post: by
6 posts views Thread by Kenneth Moss | last post: by
4 posts views Thread by =?Utf-8?B?Qm9i?= | last post: by
reply views Thread by =?Utf-8?B?RVNQTlNUSQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.