From c055db4ddcbd48b2140fa0ab37a6c63135fd05dd Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 5 Apr 2019 14:00:51 -0500 Subject: [PATCH] [objcruntime] Fix options for watchOS default HTTP handler and remove (now) unused TLS options --- src/ObjCRuntime/RuntimeOptions.cs | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/ObjCRuntime/RuntimeOptions.cs b/src/ObjCRuntime/RuntimeOptions.cs index aac1906fd8..81bc70ccee 100644 --- a/src/ObjCRuntime/RuntimeOptions.cs +++ b/src/ObjCRuntime/RuntimeOptions.cs @@ -22,10 +22,6 @@ namespace ObjCRuntime { const string CFNetworkHandlerValue = "CFNetworkHandler"; const string NSUrlSessionHandlerValue = "NSUrlSessionHandler"; - const string DefaultTlsProviderValue = "default"; - const string LegacyTlsProviderValue = "legacy"; - const string AppleTlsProviderValue = "appletls"; - string http_message_handler; #if MTOUCH || MMP @@ -36,7 +32,6 @@ namespace ObjCRuntime { { var options = new RuntimeOptions (); options.http_message_handler = ParseHttpMessageHandler (app, http_message_handler); - ParseTlsProvider (tls_provider); return options; } @@ -45,7 +40,7 @@ namespace ObjCRuntime { switch (value) { // default case null: - return HttpClientHandlerValue; + return (app.Platform == Utils.ApplePlatform.WatchOS) ? NSUrlSessionHandlerValue : HttpClientHandlerValue; case CFNetworkHandlerValue: case HttpClientHandlerValue: if (app.Platform == Utils.ApplePlatform.WatchOS) { @@ -62,23 +57,6 @@ namespace ObjCRuntime { } } - static string ParseTlsProvider (string value) - { - switch (value) { - // default - case null: - return DefaultTlsProviderValue; - case DefaultTlsProviderValue: - case AppleTlsProviderValue: - return value; - case LegacyTlsProviderValue: - ErrorHelper.Warning (2016, "Invalid TlsProvider `{0}` option. The only valid value `{1}` will be used.", value, AppleTlsProviderValue); - return AppleTlsProviderValue; - default: - throw ErrorHelper.CreateError (2011, "Unknown TlsProvider `{0}`. Valid values are default or appletls", value); - } - } - internal void Write (string app_dir) { // note: we always create the file because the simulator won't remove old files