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
?