Include support for SSL/TLS right in System when building for the MONODROID profile
authorMarek Habersack <grendel@twistedcode.net>
Fri, 25 Apr 2014 13:20:38 +0000 (15:20 +0200)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 25 Apr 2014 19:39:53 +0000 (21:39 +0200)
commit34fb07d05febe08a5662bca68cdf132c3bbc08c1
tree8c1b924057b28a1849ede0353abe8862da5c86f2
parentf964245f21ad3d82d3fef534530a14ec1adf98b6
Include support for SSL/TLS right in System when building for the MONODROID profile

This patch builds upon commit 96a8500795960ae1d9e81e28095c3e2dda303342 which placed parts of Mono.Security
responsible for dealing with SSL/TLS certificates for the purpose of certificate verification. The code enables
validation of the certifcates even if the user does not provide their own validation callback. The changes as related to
the original commit are few, basically consisting of enabling the same code used by MonoTouch in the MonoDroid context with
the only actual code change being the certificate validation bit mentioned above.

Since the change involves adding a subset of Mono.Security files to the monodroid version of System.dll, it is
also necessary to remove Mono.Android's dependence on Mono.Security.dll. The reason is that the code in AndroidPlatform
which looks up TLS support methods in Mono.Android.dll would use a type (X509CertificateCollection) that is now part of
System.dll but is *also* in Mono.Security.dll referenced by Mono.Android.dll and therefore the lookup would fail since
we'd have two distinct types from the reflection point of view.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18962
24 files changed:
mcs/class/System/Makefile
mcs/class/System/Mono.Http/NtlmClient.cs
mcs/class/System/System.Net.Mail/SmtpClient.cs
mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net/EndPointListener.cs
mcs/class/System/System.Net/HttpConnection.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/ServicePointManager.cs
mcs/class/System/System.Net/WebConnection.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/PublicKey.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtension.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509KeyUsageExtension.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Store.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.cs
mcs/class/System/System.Security.Cryptography/AsnEncodedData.cs
mcs/class/System/System/AndroidPlatform.cs
mcs/class/System/monodroid_System.dll.sources