[objcruntime] Fix options for watchOS default HTTP handler and remove (now) unused TLS options

This commit is contained in:
Sebastien Pouliot 2019-04-05 14:00:51 -05:00
Родитель 349b73e390
Коммит c055db4ddc
1 изменённых файлов: 1 добавлений и 23 удалений

Просмотреть файл

@ -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