Bug 8505 - ServerCertificateValidationCallback never called
Summary: ServerCertificateValidationCallback never called
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-11-19 11:17 UTC by Arjan Nieuwenhuis
Modified: 2012-11-20 09:38 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Arjan Nieuwenhuis 2012-11-19 11:17:50 UTC
After the upgrade to MonoTouch 6.0.6 I am no longer able to connect to websites with a not yet trusted SSL certificate.
I used the following lines of code that aren't called within a MonoTouch project after the upgrade:

ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => true);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

It still works with a console application project though.
Comment 1 Sebastien Pouliot 2012-11-19 12:01:39 UTC
The callback works. However MonoTouch 6.0.6 has an issue with some SSLv3 servers. In this case the connection might fail before reaching your ServerCertificateValidationCallback callback.

The issue is already fixed and will be in the next stable update. Note that, if possible, you should use TLSv1 for all encrypted HTTPS traffic (there's no technical/security benefit to use SSLv3).

> It still works with a console application project though.

It depends on the version of Mono being executed. One recent version has the same (now fixed) issue.

*** This bug has been marked as a duplicate of bug 8312 ***
Comment 3 Sebastien Pouliot 2012-11-20 09:38:12 UTC
You need to downgrade to 6.0.4 and it can be installed on top of 6.0.6. 
Previous releases can be downloaded from the customer portal. 
If you have need help please contact support@xamarin.com