HttpHandlerResource has a HttpClientHandler property which is not available when using NSUrlSessionHandler on the Mac #7298
Labels
Area:HttpCommunication
Functionality:SDK
The NuGet client packages published to nuget.org
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Type:DCR
Design Change Request
Milestone
Details about Problem
The HttpHandlerResource has a HttpClientHandler property. A native HttpMessageHandler, which can be used by HttpClient, does not have to be a HttpClientHandler derived class. With Xamarin.Mac the native handler is NSUrlSessionHandler which derives from HttpMessageHandler. The NSUrlSessionHandler cannot be used with the HttpHandlerResourceV3 and a null value cannot be passed since there is a null check.
Searching the code it looks like the only place where this is used is in the DownloadResourcePluginProvider class where it is used to pass the HttpClientHandler.Proxy to the GetCredentialsRequestHandler. Is there another way we can handle this without requiring a HttpClientHandler as part of the HttpHandlerResource?
For now I can create a dummy HttpClientHandler - however if NuGet starts using the HttpClientHandler property for other things then this will likely not work if Visual Studio for Mac is using the NSUrlSessionHandler. Visual Studio for Mac can implement its own version of the HttpHandlerResourceV3Provider but having HttpHandlerResourceV3 require a HttpClientHandler is problematic here.
The text was updated successfully, but these errors were encountered: