I`m trying to use wcf to make SOAP call with mutual certificates but keeps getting errors either
'The request was aborted: Could not create SSL/TLS secure channel.' or
'The remote server returned an error: (500) Internal Server Error Missing wsse:Security header in request'
Similar request done in SOAP UI works but n C# doesnt want to pass. I also looked what exactly is being sent and found that soap envolope indeed is missing wsse:Security in headers. How I can make it work?
WSHttpBinding myBinding = new WSHttpBinding();
myBinding.Security.Mode = SecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
EndpointAddress ea = new EndpointAddress("https://[securedEndpoint]/Calculator");
CalculatorClient cc = new CalculatorClient(myBinding, ea);
cc.ClientCredentials.ClientCertificate.SetCertificate(
StoreLocation.CurrentUser,
StoreName.Root,
X509FindType.FindBySerialNumber,
"37802b632e74e355");
cc.ClientCredentials.ServiceCertificate.SetDefaultCertificate(
StoreLocation.CurrentUser,
StoreName.Root,
X509FindType.FindBySerialNumber,
"29f3e22fc1ae45be");
// Begin using the client.
try
{
cc.Open();
Console.WriteLine(cc.Add(200, 1111));
Console.ReadLine();
// Close the client.
cc.Close();
}