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

[Android][iOS] Enable HttpClientHandler.DangerousAcceptAnyServerCertificateValidator when using native handlers #73763

Conversation

simonrozsival
Copy link
Member

@simonrozsival simonrozsival commented Aug 11, 2022

The static HttpClientHandler.DangerousAcceptAnyServerCertificateValidator getter throws PNSE when the native HTTP handler is enabled because Xamarin.Android's AndroidMessageHandler and Xamarin.iOS NSUrlSessionHandler didn't use to have support for the ServerCertificateCustomValidationCallback.

We already implemented the Android part in .NET 6 and support in the iOS implementation is WIP and we should be able to implement it in time for .NET 7. IMO it's safe to remove the exception in the getter in .NET 7.

Closes #68898

@ghost
Copy link

ghost commented Aug 11, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

The static HttpClientHandler.DangerousAcceptAnyServerCertificateValidator getter throws PNSE when the native HTTP handler is enabled because Xamarin.Android's AndroidMessageHandler and Xamarin.iOS NSUrlSessionHandler didn't use to have support for the ServerCertificateCustomValidationCallback.

We already implemented the Android part in .NET 6 and support in the iOS implementation is WIP and we should be able to implement it in time for .NET 7. IMO it's safe to remove the exception in the getter in .NET 7.

Author: simonrozsival
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@akoeplinger akoeplinger merged commit d2c991e into dotnet:main Aug 11, 2022
@karelz karelz added this to the 7.0.0 milestone Aug 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants