Calling a webservice with an untrusted SSL certificate

For a customer I had a very simple Biztalk task: call a webservice from an orchestration.


The thing was that the webservice was secured using SSL, but Biztalk normally detects that and everything works fine.
However, in this case the SSL certificate was untrusted because it is a test environment.
I created a .NET client to test the webservice and I had to install the certificate as trusted in order to get it to work.
The Biztalk application refused to work and showed the following exception:


Error details: WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. AuthenticationException: The remote certificate is invalid according to the validation procedure.


After a long search Tomas Restrepo pointed me in the right direction.
The solution was very simple, just add the certificate also in the user store of the user the Biztalk services are running under.