I today encountered the dreaded exception: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel" when trying to communicate with an SSL webservice.

The reason was as expected that the certificate presented by the webserver (integral part of an IHC controller) was not trusted by my Client PC. To retrieve this certificate was far from easy, hence I solved the issue by using a workaround that allows you to hook into the certificate validation mechanism on the client side.

Now the certificate validation is performed from your own code! Returning true to everything of-course means that you trust everything which is somewhat of a statement; but in some scenarios it can be necessary if you are in a controlled environment.