BasicHttpBinding with certificate

Discussion in 'ASP .Net Security' started by Mirco, Jun 21, 2010.

  1. Mirco

    Mirco Guest

    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
     
    Mirco, Jun 21, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zorba
    Replies:
    0
    Views:
    958
    Zorba
    Jun 4, 2004
  2. Diego Rivero
    Replies:
    0
    Views:
    362
    Diego Rivero
    Jul 4, 2003
  3. Luca Caruso

    client certificate

    Luca Caruso, Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    Luca Caruso
    Jul 15, 2003
  4. Helena Cai
    Replies:
    0
    Views:
    413
    Helena Cai
    Aug 29, 2004
  5. Replies:
    0
    Views:
    426
Loading...

Share This Page