BasicHttpBinding with certificate

M

Mirco

Hi,
I'm experiencing problem using BasicHttpBinding with client authentication
with certificate.

That's the error message: Message:An error occurred while making the HTTP
request to https://xxx. This could be due to the fact that the server
certificate is not configured properly with HTTP.SYS in the HTTPS case. This
could also be caused by a mismatch of the security binding between the client
and the server.

Server side:
....
BasicHttpBinding mybinding = new BasicHttpBinding("xxx");
mybinding.Security.Mode = BasicHttpSecurityMode.Transport;
mybinding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Certificate;
....

Client side:
....
System.ServiceModel.BasicHttpBinding myBinding = new
System.ServiceModel.BasicHttpBinding();
myBinding.Security.Mode =
System.ServiceModel.BasicHttpSecurityMode.Transport;
myBinding.Security.Transport.ClientCredentialType =
System.ServiceModel.HttpClientCredentialType.certificate;
System.ServiceModel.EndpointAddress ea = new
System.ServiceModel.EndpointAddress("https://xxx");
xxServiceClient cc = new xxServiceClient(myBinding, ea);
cc.ClientCredentials.ClientCertificate.Certificate = new
System.Security.Cryptography.X509Certificates.X509Certificate2();
cc.ClientCredentials.ClientCertificate.Certificate.Import(@"\\xx");
....

I have already installed the server certificate with httpcfg.exe

Thanks,
Mirco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,446
Members
47,101
Latest member
vaibhav87

Latest Threads

Top