Exception during secure communication implementation

Posted by Liran on Stack Overflow See other posts from Stack Overflow or by Liran
Published on 2010-04-28T14:41:15Z Indexed on 2010/04/28 14:43 UTC
Read the original article Hit count: 487

Filed under:

hi everyone. im trying to implement simple secured client server communiction using WCF. when im launching mt server everty thing is OK , But when im launching my client im getting this error: Error : An error occurred while making the HTTP request to https://localhost:800 0/ExchangeService. 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 caus ed by a mismatch of the security binding between the client and the server.

this is the server code :

        Uri address    = new Uri("https://localhost:8000/ExchangeService");

        WSHttpBinding binding = new WSHttpBinding();

        //Set Binding Params
        binding.Security.Mode = SecurityMode.Transport;
        binding.Security.Transport.ClientCredentialType =     HttpClientCredentialType.None;
        binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;


        Type        contract = typeof(ExchangeService.ServiceContract.ITradeService);
        ServiceHost host = new ServiceHost(typeof(TradeService)); 


        host.AddServiceEndpoint(contract, binding, address);
        host.Open();   

this is the client configuration (app.config):

</client>
<bindings>
  <wsHttpBinding>
    <binding name="TradeWsHttpBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"
                   proxyCredentialType ="None"/>
      </security>

    </binding>
  </wsHttpBinding>
</bindings>

the security configuration at both the client and the server are the same , and i dont need certificate for the server in that kind of security (transport) so why do i get this exception ????

thanks...

© Stack Overflow or respective owner

Related posts about wcf