2

I am attempting to connect to a web service. The certificate for this service is located on the server. I am creating the service like so:

BasicHttpBinding basicbinding = new BasicHttpBinding();

// Transport needed for HTTPS according to msft
basicbinding.Security.Mode = BasicHttpSecurityMode.Transport;

endPoint = new Client(basicbinding, new EndpointAddress(myURL);

When I try to get data from the service (endPoint.getSomeData(...) I get an exception:

Could not establish trust relationship for the SSL/TLS secure channel with authority..."

Question: Do I need to also specify:

basicbinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;

And if so, do I need to have the cert on my end too?

Update: The server doesn't authenticate using client certificates. So I guess all I need to do is set basicbinding.Securtiy.Mode to BasicHttpSecurityMode.Transport and set basicbinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None?

jww
  • 97,681
  • 90
  • 411
  • 885
John Horstkamp
  • 87
  • 1
  • 1
  • 10
  • Is the server certificate trusted by the client? Or signed by a certificate that is trusted by the client? – Ronald Wildenberg Aug 15 '14 at 18:16
  • I don't know the answers to those questions. I do not have access to the cert. I only know that is was created from a trusted authority. – John Horstkamp Aug 15 '14 at 18:29
  • possible duplicate of [WCF : Could not establish trust relationship for the SSL/TLS secure channel with authority - back to the drawing board](http://stackoverflow.com/questions/1742938/wcf-could-not-establish-trust-relationship-for-the-ssl-tls-secure-channel-with) – stuartd Aug 15 '14 at 18:44
  • Just got a little more info: – John Horstkamp Aug 15 '14 at 19:53
  • I just got some more info: The server doesn't authenticate using client certificates. So I guess all I need to do is set basicbinding.Securtiy.Mode to BasicHttpSecurityMode.Transport and set basicbinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None ? – John Horstkamp Aug 15 '14 at 20:04

0 Answers0