But there are other cases as well.
You may get the following exception at the client:
The inner exception shows:
The reason for that is that the certificate the server uses is not trusted on the client machine. We can see this by double-clicking on the certificate in the file system or in the windows certificate store:
You have 2 ways to solve this:
1. Make sure the service certificate is trusted on the client machine. For example install its issuer certificate in the trusted root store.
2. This is just for testing and should not go to production. You can disable the server authentication by the client: On the client side create a new endpoint behaviour with a "clientCredentials" behaviour element and set its serviceCertificate/authentication/certificateValidationMode to "None".
The app.config may look like this now:
<authentication certificateValidationMode="None" />
A picture may be better here:
Don't forget to link that behaviour to the endpoint:
<endpoint ... behaviorConfiguration="NewBehavior"... />
Note that after you solve this error you may see a related cryptic WCF error message.