column name and ordinal fix...tested on 10.1
[mono.git] / mcs / class / System / Mono.Net.Security / MonoTlsProviderFactory.Droid.cs
1 // Copyright 2015 Xamarin Inc. All rights reserved.
2 #if SECURITY_DEP
3 using System;
4 using MSI = Mono.Security.Interface;
5 using Mono.Btls;
6
7 namespace Mono.Net.Security
8 {
9         static partial class MonoTlsProviderFactory
10         {
11                 static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
12                 {
13                         MSI.MonoTlsProvider provider = null;
14                         var type = Environment.GetEnvironmentVariable ("XA_TLS_PROVIDER");
15                         switch (type) {
16                         case null:
17                         case "default":
18                         case "legacy":
19                                 return new LegacyTlsProvider ();
20                         case "btls":
21                                 if (!IsBtlsSupported ())
22                                         throw new NotSupportedException ("BTLS in not supported!");
23                                 return new MonoBtlsProvider ();
24                         default:
25                                 throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider));
26                         }
27                 }
28         }
29 }
30 #endif