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

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Zorba
    Replies:
    0
    Views:
    1,169
    Zorba
    Jun 4, 2004
  2. Diego Rivero
    Replies:
    0
    Views:
    464
    Diego Rivero
    Jul 4, 2003
  3. Luca Caruso

    client certificate

    Luca Caruso, Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    617
    Luca Caruso
    Jul 15, 2003
  4. borovA
    Replies:
    1
    Views:
    12,718
    borovA
    Oct 3, 2003
  5. Subra Mallampalli
    Replies:
    0
    Views:
    608
    Subra Mallampalli
    Oct 2, 2003
  6. Subra Mallampalli
    Replies:
    0
    Views:
    615
    Subra Mallampalli
    Oct 2, 2003
  7. Helena Cai
    Replies:
    0
    Views:
    788
    Helena Cai
    Aug 29, 2004
  8. Replies:
    0
    Views:
    857
Loading...