EDIT:
Finally, I determined that the IClientMessageInspector does not seem to reflect the signature of the message, so when I actually received the signature in my request, I did not know that. So now for my new, real question ...
How to configure a WCF client to present an SSL client certificate and sign a SOAP header?
var myBinding = new BasicHttpBinding();
myBinding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.Certificate;
This will cause the header to have a signed timestamp. However, the client certificate is no longer presented, and I do not receive SSL. If I changed the second line to:
myBinding.Security.Mode = BasicHttpSecurityMode.Transport;
Then I finish SSL, but my SOAP header no longer has a signature block.
Is there a way to get the HttpWebRequest so that I can manually connect the SSL Client certificate this way?
webRequest.ClientCertificates.Add(certLoader.Load(@"c:\somecert.pfx"));
Original question
WCF, , , Forum Sentry . SSL , o: , . , . , , SSL-, , SSL, .
- , , , CustomBinding.
SSL, :
var myBinding = new BasicHttpBinding();
myBinding.Security.Mode = BasicHttpSecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
var url = "https://blah.com/services/somservice";
EndpointAddress ea = new EndpointAddress(url);
var client = new SoapClient(myBinding, ea);
var certLoader = new CertificateLoader("password");
client.ClientCredentials.ClientCertificate.Certificate = certLoader.Load(@"c:\somecert.pfx");
var resp = client.somemethod(ref profile, new RequestType { version = RequestTypeVersion.Item100 });