Skip to content

Defaults communication between SDK & IDEs #1364

@jonpryor

Description

@jonpryor

Scenario

In Xamarin.Android 8.3 (d15-7), we're changing the default SSL/TLS Implementation ($(AndroidTlsProvider)) value so that BTLS is enabled by default; see 6264be7.

That's all well and good, but what about the end-developer experience? Visual Studio for Mac shows these drop-downs:

Visual Studio for Mac SSL Options

What is Default?

The end-developer could hover their mouse of the ? on the right, but (1) that's extra work, and (2) in the case of SSL/TLS Implementation, the ? is useless: there is no description of what "Default" means.

¯_(ツ)_/¯

Additionally, the Xamarin.Android SDK team may want to change what "Default" means in the future, e.g. revert an "empty" $(AndroidTlsProvider) value to mean the "Managed TLS 1.0" while the meaning of $(AndroidClientHandler)=='' is altered.

Solution

The proposal is to update Xamarin.Android.Common.props -- which the IDE already knows about and has access to -- so that it specifies what the default is and what it means.

The proposal is for two additional MSBuild properties:

  • $(AndroidDefaultClientHandlerLabel): The label for the default HttpClient Implementation label.
  • $(AndroidDefaultTlsProviderLabel): The label for the default SSL/TLS Implementation label.

For example, at present we'd have:

<AndroidDefaultClientHandlerLabel>Default (HttpClientHandler)</AndroidDefaultClientHandlerLabel>
<AndroidDefaultTlsProviderLabel>Default (BTLS)</AndroidDefaultTlsProviderLabel>

The value of these properties would be used instead of Default in the appropriate drop-down boxes within the IDEs.

Alternative take: Instead of "just" specifying the default value, we could provide all the supported values in a ;-and-:-delimited list: ; between descriptions, and : to separate label names from .csproj values:

<AndroidDefaultClientHandlerLabels>
    Default (HttpClientHandler):;
    Managed (HttpClientHandler):System.Net.Http.HttpClientHandler, System.Net.Http;
    AndroidClientHandler:Xamarin.Android.Net.AndroidClientHandler
</AndroidDefaultClientHandlerLabels>
<AndroidDefaultTlsProviderLabels>
    Default (BTLS):;
    Native TLS 1.2+:btls;
    Managed TLS 1.0:legacy;
</AndroidDefaultTlsProviderLabels>

Discussion

The downside with either of these solutions is that it hardcodes localizable strings into an unlocalizable file. "Default" (should?) be localized. Perhaps the above solutions are "fine" and we just need to pass the resulting values through e.g. gettext() (or however the IDEs handle localization), or perhaps some other solution is needed.

Metadata

Metadata

Labels

Area: CommercialIssues with non-OSS components.possibly-staleIssues that are potentially no longer relevant.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions