Skip to content

Need a thread safe mechanism to opt in to ManagedHandler for a single instance of HttpClientHandler #23621

@mconnew

Description

@mconnew

The recent changes in HttpClientHandler on OSX to use the native security libraries has caused server certificate validation callbacks to not be supported. The ManagedHandler does support this, but is missing other functionality needed. WCF needs a way to instantiate a single HttpClientHandler instance to explicitly use ManagedHandler. If an instance of a WCF ChannelFactory has been configured to use certificate authentication, we need to be able to use a custom certificate validation callback so need to use ManagedHandler for that instance. If in the same process a different authentication mechanism is requested for a different instance of a WCF ChannelFactory, that instance needs to use the libcurl based HttpClientHandler implementation as it is more feature complete. While we can set the relevant environment variable before calling the HttpClientHandler constructor and then restore it to it's previous state, this isn't thread safe as we could interfere with an instantiation happening outside of WCF on another thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.HttpenhancementProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions