0

I have a WCF service running under IIS configured to use SSL, with a valid certificate already installed and running. Visiting the website with

https://my_website/anypage.aspx 

I can access the page. Visiting the url

https://my_website/mywcfservice.svc 

I can see the webservice page: "You have created a service. To test this service, you will need to create a client and use it to call the service(...) ". Note that I'm receiving anyway the warning page saying "There is a problem with this website's security certificate" where I click "Continue to this website".

in server side, the web.config is configured with:

<security mode="Transport">
  <transport clientCredentialType="None" />
</security>

... ...

In client side, I'm not using proxy or config file. I'm connecting using code only, like:

this.Channel = new ChannelFactory<T>(binding, new EndpointAddress(serviceUri));
((WSHttpBinding)this.Channel.Endpoint.Binding).Security.Mode = SecurityMode.Transport;
((WSHttpBinding)this.Channel.Endpoint.Binding).Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
this.Channel.CreateChannel();

I have strong rules to connect from client by code so I can't use other way. the channel is well opened but when I'm calling any method I receive error "the remote certificate is invalid according to the validation procedure."

Without https was working ok.

In client side I have a many certificates in "Trusted Root Certification Authorities\Certificates". All of them are also trusted in server side.

Where could be the issue, in client or server side ?? Maybe I need to specify one very precise certificate to use in client side ??

any help appreciate, thanks.

user810917
  • 241
  • 4
  • 12
  • Check this http://stackoverflow.com/questions/9058096/how-to-call-the-default-certificate-check-when-overriding-servicepointmanager-se – iSamnium Jul 19 '12 at 17:57

1 Answers1

3

Note that I'm receiving anyway the warning page saying "There is a problem with this website's security certificate" where I click "Continue to this website".

Your client machine does not trust the SSL certificate that you are using on the server. The WCF error you receive is the equivalent to the message that you are getting when you try to hit the service in your browser.

In client side I have a many certificates in "Trusted Root Certification Authorities\Certificates". All of them are also trusted in server side.

You need to configure your client machine to properly trust your SSL certificate. Once you can access the service in your browser with no errors, your client code should work.

TheNextman
  • 12,428
  • 2
  • 36
  • 75