我試圖將現有的應用程序移植到Mono 2.6.7/Linux。 一項任務是通過服務器上的WebClient方法接收數據,其中無效的 SSL證書。單聲道,Web客戶端和無效的SSL證書
我們的.Net 3.5的Windows下的代碼以接受所有證書工作正常:
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;
}
我試過雜項。
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure
任何想法如何來解決這個問題:使用的東西具體單聲道的dll但總是相同的錯誤,實現單同樣沒有?
注意事項:請不要將此代碼投入生產。這類似於引入了最近在iOS和MacOS中發現的同樣嚴重的安全漏洞:http://www.neowin.net/news/serious-vulnerability-found-in-ssltls-on-os-x-mavericks-and -ios -7-易利用的 – dotMorten 2014-09-02 00:19:30