I'm trying to port an existing Application to Mono 2.6.7/Linux. One Task is to receive data via the WebClient method from Servers with an invalid SSL Cert.
Our .Net 3.5 Code under Windows to accept all certificates works fine:
ServicePointManager.ServerCertificateValidationCallback = TrustCertificate;
StreamReader webReader = new StreamReader(webClient.OpenRead(url));
...
private static bool TrustCertificate(object sender, X509Certificate x509Certificate, X509Chain x509Chain, SslPolicyErrors sslPolicyErrors)
{
// all Certificates are accepted
return true;
}
I tried misc. things to achieve the same in Mono without using specific Mono dll's but always the same error:
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure
Any ideas how to solve this issue?