[release/6.0] Add System.Net.Http ServerCertificateCustomValidationCallback ILLink Suppression #58508
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.
Backport of #58456 to release/6.0
Fixes #57537
During PR #57555, it was unclear what the correct suppression syntax would be for a return type of
Func<HttpRequestMessage, X509Certificate2?, X509Chain?, SslPolicyErrors, bool>
. With some helpful switches to generate the right warning suppression syntax via--generate-warning-suppressions xml
inRuntimePackILLinkArgs
, this PR adds the correct warning suppression./cc @mdh1418
Customer Impact
When supporting either using the native
HttpMessageHandler
types in Xamarin orSocketsHttpHandler
as the underlying handler inHttpClientHandler
, some APIs such asServerCertificateCustomValidationCallback
had thrown PNSE when the native handler was enabled. It didn't make sense to always throw PNSE, and a majority of the methods were modified to suppress ILLink error messages except forServerCertificateCustomValidationCallback
because of its return type.Removes PNSE from
ServerCertificateCustomValidationCallback
Adds ILLink error message suppression for
ServerCertificateCustomValidationCallback
Without this PR,
ServerCertificateCustomValidationCallback
will continue to throw PNSE.Testing
Risk
Low, this PR will reenable
ServerCertificateCustomValidationCallback
instead of throwingArg_PlatformNotSupported
exception.