diff options
Diffstat (limited to 'mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs')
-rw-r--r-- | mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs index 75138d8c715..2ddf74fa5db 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs @@ -161,18 +161,28 @@ namespace Mono.Net.Security if (providerRegistration != null) return; providerRegistration = new Dictionary<string,string> (); - providerRegistration.Add ("legacy", "Mono.Net.Security.LegacyTlsProvider"); - - if (Platform.IsMacOS) - providerRegistration.Add ("default", "Mono.AppleTls.AppleTlsProvider"); - else - providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider"); - if (IsBtlsSupported ()) - providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider"); + string legacyProvider = "Mono.Net.Security.LegacyTlsProvider"; + providerRegistration.Add ("legacy", legacyProvider); + + string defaultProvider = null; + if (IsBtlsSupported ()) { + var btlsProvider = "Mono.Btls.MonoBtlsProvider"; + providerRegistration.Add ("btls", btlsProvider); + defaultProvider = btlsProvider; + } - providerRegistration.Add ("apple", "Mono.AppleTls.AppleTlsProvider"); - + if (Platform.IsMacOS) { + var appleProvider = "Mono.AppleTls.AppleTlsProvider"; + providerRegistration.Add ("apple", appleProvider); + defaultProvider = appleProvider; + } + + if (defaultProvider == null) + defaultProvider = legacyProvider; + + providerRegistration.Add ("default", defaultProvider); + X509Helper2.Initialize (); } } |