示例#1
0
        internal static void InitializeInternal()
        {
            lock (locker) {
                if (initialized)
                {
                    return;
                }

                InitializeProviderRegistration();

                MSI.MonoTlsProvider provider;
                try {
                    provider = CreateDefaultProviderImpl();
                } catch (Exception ex) {
                    throw new NotSupportedException("TLS Support not available.", ex);
                }

                if (provider == null)
                {
                    throw new NotSupportedException("TLS Support not available.");
                }

                if (!providerCache.ContainsKey(provider.ID))
                {
                    providerCache.Add(provider.ID, provider);
                }

                X509Helper2.Initialize();

                defaultProvider = provider;
                initialized     = true;
            }
        }
示例#2
0
        static void InitializeProviderRegistration()
        {
            lock (locker) {
                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");
                }

                providerRegistration.Add("apple", "Mono.AppleTls.AppleTlsProvider");

                X509Helper2.Initialize();
            }
        }
示例#3
0
        internal static void InitializeInternal(string provider)
        {
            lock (locker) {
                if (initialized)
                {
                    throw new NotSupportedException("TLS Subsystem already initialized.");
                }

                defaultProvider = LookupProvider(provider, true);

                X509Helper2.Initialize();
                initialized = true;
            }
        }
示例#4
0
 static void InitializeProviderRegistration()
 {
     lock (locker) {
         if (providerRegistration != null)
         {
             return;
         }
         providerRegistration = new Dictionary <string, string> ();
         providerRegistration.Add("newtls", "Mono.Security.Providers.NewTls.NewTlsProvider, Mono.Security.Providers.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
         providerRegistration.Add("oldtls", "Mono.Security.Providers.OldTls.OldTlsProvider, Mono.Security.Providers.OldTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
         providerRegistration.Add("boringtls", "Xamarin.BoringTls.BoringTlsProvider, Xamarin.BoringTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=672c06b0b8f05406");
         X509Helper2.Initialize();
     }
 }
示例#5
0
 static void InitializeProviderRegistration()
 {
     lock (locker) {
         if (providerRegistration != null)
         {
             return;
         }
         providerRegistration = new Dictionary <string, string> ();
         providerRegistration.Add("legacy", "Mono.Net.Security.LegacyTlsProvider");
         providerRegistration.Add("default", "Mono.Net.Security.LegacyTlsProvider");
         if (Mono.Btls.MonoBtlsProvider.IsSupported())
         {
             providerRegistration.Add("btls", "Mono.Btls.MonoBtlsProvider");
         }
         X509Helper2.Initialize();
     }
 }
示例#6
0
        static void InitializeProviderRegistration()
        {
            lock (locker) {
                if (providerRegistration != null)
                {
                    return;
                }
                providerRegistration = new Dictionary <string, string> ();
                providerRegistration.Add("legacy", "Mono.Net.Security.Private.MonoLegacyTlsProvider");
                providerRegistration.Add("newtls", "Mono.Security.Providers.NewTls.NewTlsProvider, Mono.Security.Providers.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
                providerRegistration.Add("oldtls", "Mono.Security.Providers.OldTls.OldTlsProvider, Mono.Security.Providers.OldTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
#if HAVE_BTLS
                if (Mono.Btls.MonoBtlsProvider.IsSupported())
                {
                    providerRegistration.Add("btls", "Mono.Btls.MonoBtlsProvider");
                }
#endif
                X509Helper2.Initialize();
            }
        }
示例#7
0
        static void InitializeProviderRegistration()
        {
            lock (locker) {
                if (providerRegistration != null)
                {
                    return;
                }
                providerRegistration = new Dictionary <string, string> ();

                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;
                }

                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();
            }
        }