Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mconnew opened this issue Sep 21, 2017 · 3 comments
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@mconnew
Copy link
Member

mconnew commented Sep 21, 2017

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.

@stephentoub
Copy link
Member

dotnet/corefx#24173

@davidsh
Copy link
Contributor

davidsh commented Sep 25, 2017

@stephentoub Should this issue be closed now that dotnet/corefx#24173 is merged?

@stephentoub
Copy link
Member

Yes. It's not a wonderful mechanism and is hopefully only temporary until we have something better, but it does work.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

4 participants