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
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