title: SSL connection with unsigned certificate
body: <p>I am running into the following problem with an iOS app we are developing. On my server I am running  a WCF-service. This service is running in HTTPS. I wrote a small test program to see if I can connect to it from another PC:</p>
  
  <pre><code>ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) =&gt; true;
  
  Console.WriteLine("Press key to start webrequest");
  Console.ReadKey();
  
  WebRequest wr = WebRequest.Create("https://&lt;serveraddress.here.com&gt;");
  Stream stream = wr.GetResponse().GetResponseStream();
  
  Console.WriteLine(new StreamReader(stream).ReadToEnd());
  
  Console.ReadKey();
  </code></pre>
  
  <p>This works as expected and returns html-code. Notice we're using <code>ServicePointManager.ServerCertificateValidationCallback</code> to ensure that the certificate is being trusted in any case.</p>
  
  <p>The same code in MonoTouch on the iPhone however returns the following error:</p>
  
  <pre><code>System.Net.WebException has been thrown
  Error getting response stream (Write: BeginWrite failure): SendFailure
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
  </code></pre>
  
  <p>Connecting to another a signed https site (paypal for example) works without problems. Also connecting to the server without https (regular http) works fine. </p>
  
  <p>It seems like it's ignoring the <code>ServerCertificateValidationCallback</code> and failing somewhere. Is there any way to fix this?</p>