Imported Upstream version 4.6.0.150

Former-commit-id: 73e3bb1e96dd09dc931c1dfe559d2c7f7b8b02c7
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-23 13:20:38 +00:00
parent 02ac915603
commit b95516a3dd
239 changed files with 4096 additions and 1544 deletions

View File

@ -0,0 +1,36 @@
// Copyright 2015 Xamarin Inc. All rights reserved.
#if SECURITY_DEP
using System;
using MSI = Mono.Security.Interface;
#if HAVE_BTLS
using Mono.Btls;
#endif
namespace Mono.Net.Security
{
static partial class MonoTlsProviderFactory
{
static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
{
MSI.MonoTlsProvider provider = null;
var type = Environment.GetEnvironmentVariable ("XA_TLS_PROVIDER");
switch (type) {
case null:
case "default":
case "legacy":
return new Private.MonoLegacyTlsProvider ();
case "btls":
#if HAVE_BTLS
if (!MonoBtlsProvider.IsSupported ())
throw new NotSupportedException ("BTLS in not supported!");
return new MonoBtlsProvider ();
#else
throw new NotSupportedException ("BTLS in not supported!");
#endif
default:
throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider));
}
}
}
}
#endif