示例#1
0
 public MonoTlsProvider GetDefaultProvider()
 {
     return(MonoTlsProviderFactory.GetProvider());
 }
示例#2
0
 static MonoTlsProvider GetProvider()
 {
     return(MonoTlsProviderFactory.GetProvider());
 }
示例#3
0
 static MNS.MobileTlsProvider GetProvider()
 {
     return((MNS.MobileTlsProvider)MonoTlsProviderFactory.GetProvider());
 }
        public MonoConnectionFrameworkSetup(string name)
        {
            Name = name;

#if !__MOBILE__ && !__UNIFIED__ && !__IOS__
            var providerEnvVar = Environment.GetEnvironmentVariable("MONO_TLS_PROVIDER");
            switch (providerEnvVar)
            {
            case "btls":
                MonoTlsProviderFactory.Initialize("btls");
                break;

            case "apple":
                MonoTlsProviderFactory.Initialize("apple");
                break;

            case "default":
            case null:
#if APPLETLS
                MonoTlsProviderFactory.Initialize("apple");
#elif LEGACY
                MonoTlsProviderFactory.Initialize("legacy");
#else
                MonoTlsProviderFactory.Initialize("btls");
#endif
                break;

            case "legacy":
                MonoTlsProviderFactory.Initialize("legacy");
                break;

            default:
                throw new NotSupportedException(string.Format("Unsupported TLS Provider: `{0}'", providerEnvVar));
            }
#endif

            TlsProvider   = MonoTlsProviderFactory.GetProvider();
            UsingBtls     = TlsProvider.ID == ConnectionProviderFactory.BoringTlsGuid;
            UsingAppleTls = TlsProvider.ID == ConnectionProviderFactory.AppleTlsGuid;
            SupportsTls12 = UsingBtls || UsingAppleTls;

            SupportsCleanShutdown = CheckCleanShutdown();
            HasNewWebStack        = CheckNewWebStack();
            SupportsRenegotiation = CheckRenegotiation();
            SupportsGZip          = CheckSupportsGZip();

#if !__IOS__ && !__MOBILE__ && !__XAMMAC__
            SupportsMonoExtensions = true;
#endif

            if (CheckAppleTls())
            {
#if !__IOS__ && !__MOBILE__ && !__XAMMAC__
                if (UsingBtls)
                {
                    SecondTlsProvider = MonoTlsProviderFactory.GetProvider("apple");
                }
                if (UsingAppleTls)
                {
                    SecondTlsProvider = MonoTlsProviderFactory.GetProvider("btls");
                }
#endif
            }
            else
            {
                if (UsingAppleTls)
                {
                    throw new NotSupportedException("AppleTls is not supported in this version of the Mono runtime.");
                }
            }

            InitReflection();
        }
示例#5
0
        public void GetProvider()
        {
            var provider = MonoTlsProviderFactory.GetProvider();

            Assert.IsNotNull(provider, "TLS Provider");
        }