1
votes

I am trying to integrate with a Web Service end point which require Basic and Client Certificate for authentication using WCF. I tried below different setting based on suggestions online but still I am receiving "Could not establish secure channel for SSL/TLS with authority XXXXX". Server uses well known CA which is already available in Windows Certificate Store. In code I am adding ClientCredentials.UserName.UserName , ClientCredentials.UserName.Password & ClientCredentials.ClientCertificate.Certificate successfully.

1)

<security mode="TransportWithMessageCredential">
     <transport clientCredentialType="Basic"/>
 </security>

Result : "Could not establish secure channel for SSL/TLS with authority XXXXX"

2)

<security mode="TransportWithMessageCredential">
     <transport clientCredentialType="Basic" />
     <message clientCredentialType="Certificate" />
 </security>

Result : Result : "Could not establish secure channel for SSL/TLS with authority XXXXX"

3)

<security mode="Transport">
            <transport clientCredentialType="Certificate"/>
             <message clientCredentialType="UserName" />
  </security>

Result : The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="Realm"'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

How to attach the Client Certificate using Basic Authentication since the server is expecting Basic authentication based on error returned when setting clientCredentialType as "Certificate".

Note: Using SOAPUI I can successfully connect with server

1
Thank you for your response but how this article is related to my query?Noor Mohamed
Just showing a working example of SSL. If you are successful with SOAPUI I would use a sniffer like wireshark or fiddler and compare SOAPUI results with you app. Usually adding missing http header will fix issue.jdweng

1 Answers

0
votes

I replaced 2.0 Web Service Reference instead of a WCF Service Reference to send request with both Basic &Client Authentication and it worked as expected.

Note : Web Reference is old style deprecated model.