Hi everyone!
I need help with a security issue. I have an orchestration exposed as
a web service. Then I want to secure it using transport mode with
certificates. I have created one with "CN=localhost" in personal
store.
Then I wrote a client example to access my web service and I received
an error message "The caller was not authenticated by the service".
Here is my client code example :
EndpointAddress epAddress = new EndpointAddress("
http://localhost/
EnvoiDCI/WcfService_EnvoiDCIOrchestrastion.svc");
WSHttpBinding binding = new WSHttpBinding(SecurityMode.Transport);
binding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Certificate;
WcfService_EnvoiDCIOrchestrastionClient client = new
WcfService_EnvoiDCIOrchestrastionClient(binding, epAddress);
client.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine,
StoreName.My, X509FindType.FindBySubjectName, "localhost");
client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode
= X509CertificateValidationMode.PeerOrChainTrust;