This article gave me an idea how to solve the problem.
Asp.net checks whether a server certificate's name "CN= ..." matches the server's domain name.
So if the external server's certificate does not comply to that rule a https request from a asp.net application will not trust the connection. So if you have no chance to change the external server's configuration (3rd party) you have to disable the check.
It can be switched off by passing a custom delegate to asp.net's (mainly) static ServicePointManager class.
I put that bit into a static constructor of my https connector-class:
(however that check will be switched off for any https connection in the whole application)
public class MyExternalSslServiceConnector : IMyExternalServiceConnector<br />
{<br />
protected string ServiceUrl { get; set; }<br />
public X509Certificate2 SslCertificate { get; set; }<br />
<br />
static MyExternalSslServiceConnector()<br />
{<br />
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };<br />
}<br />
<br />
public MyExternalSslServiceConnector(string myExternalServiceUrl, X509Certificate2 sslCertificate)<br />
{<br />
this.ServiceUrl = myExternalServiceUrl;<br />
this.SslCertificate = sslCertificate;<br />
}<br />
<br />
}
Kind regards, C.