Is there way to attach client side SSL file (.pfx) file in WCF binding? I don't want to use certificate store.
A:
This way you can bind SSL client certificate in the code
WSHttpBinding myBinding = new WSHttpBinding();
myBinding.Security.Mode = SecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Certificate;
webServiceProxyInstance.ClientCredentials.ClientCertificate.SetCertificate(
StoreLocation.CurrentUser,
StoreName.My,
X509FindType.FindByThumbprint,
"fa f9 2d e3 fb 01 18 db 24 2a 49 56 ff f5 8b 7f e0 59 d4 98");
amz
2010-07-09 20:06:54
That's actually still using the windows certificate store, not a certificate in a pfx file.
tomasr
2010-07-09 23:03:26
A:
This should work
webServiceProxyInstance.ClientCredentials.ClientCertificate.Certificate = new X509Certificate2("path to the pfx file", "password to open the private key");
amz
2010-07-12 20:31:54