Skip to content

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

Merged
akoeplinger merged 1 commit into
dotnet:mainfrom
simonrozsival:enable-dangerous-accept-any-server-certificate-validator-on-android-ios
Aug 11, 2022
Merged

akoeplinger merged 1 commit into
dotnet:mainfrom
simonrozsival:enable-dangerous-accept-any-server-certificate-validator-on-android-ios

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Aug 11, 2022 •

Copy link
Copy Markdown
Member

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

ghost commented Aug 11, 2022

Copy link
Copy Markdown

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

Development

Successfully merging this pull request may close these issues.

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

3 participants