[d16-2] [foundation] Add custom trust/certificate validation to NSUrlSessionHandler. Fix #4170 - #6110
Merged
Merged
Conversation
…andler. Fix dotnet#4170 Basic application (size) for doing an `HttpClient.GetAsync`, release/llvm, 64bits only - NSUrlSessionHandler (master): 6.4 MB - NSUrlSessionHandler (PR#5936): 7.7 MB - NSUrlSessionHandler (this PR): 6.4 MB The size increase occurs because of the reference to .net `X509*` types. This brings a lot of additional code, including managed cryptographic code, inside the application - even when the feature is **not** used. The solution is to expose an API that only use native (OS) types, which are mostly already part of the application. This has a very low impact on existing applications. It's still possible to hook back to .NET validation if needed (it should not in most cases) but, in this case, the extra price will only be _paid_ if used (and can be lower if the code is needed by something else from the application). In comparison using other `HttpClient` handler produce app sizes of - HttpClientHandler (managed): 10.4 MB - CFNetworkHandler: 6.8 MB Based on/supersede dotnet#5733 Fix dotnet#4170
monojenkins
requested review from
chamons,
rolfbjarne and
spouliot
as code owners
May 23, 2019 12:09
chamons
approved these changes
May 23, 2019
Contributor
Author
|
Build success |
bholmes
approved these changes
May 23, 2019
rolfbjarne
approved these changes
May 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic application (size) for doing an
HttpClient.GetAsync, release/llvm, 64bits onlyThe size increase occurs because of the reference to .net
X509*types.This brings a lot of additional code, including managed cryptographic
code, inside the application - even when the feature is not used.
The solution is to expose an API that only use native (OS) types, which
are mostly already part of the application. This has a very low impact
on existing applications.
It's still possible to hook back to .NET validation if needed (it should
not in most cases) but, in this case, the extra price will only be
paid if used (and can be lower if the code is needed by something else
from the application).
In comparison using other
HttpClienthandler produce app sizes ofBased on/supersede #5733
Fix #4170
Backport of #6103.
/cc @spouliot