Click here to Skip to main content
15,887,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
We are facing issue while trying to connect to a third party web service (webmethod) using certificate authentication using C#.NET. When we try the same through Soup UI, after installing client’s chain certificate in JKS (Java Key Store), it is working perfectly.

We are trying to pass the exported PFX certificate using

X509Certificate2(“.pfx file path” , ”password”) or using
objClient.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.Root, X509FindType.FindBySubjectName, "Certificate");

We are getting below error "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''."
In the diagnostics log we are getting “The remote server returned an error: (401) Unauthorized.”

The same thing works perfectly when the authentication is user name and password instead of SSL.

Request you to kindly help us on this, this is becoming a show stopper for product to go live.

Kindly do the needful.
Posted

1 solution

Ensure Anonymous Authentication is enabled and then RESET IIS.
 
Share this answer
 
v2
Comments
Richard Deeming 9-Jan-24 7:52am    
Aside from the fact that this question is over nine years old, the OP clearly did NOT want to disable authentication for their application!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900