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

[BUG] MissingMethodException: set_ServerCertificateCustomValidationCallback #2212

Closed
stevejgordon opened this issue Nov 2, 2023 · 0 comments · Fixed by #2213
Closed

[BUG] MissingMethodException: set_ServerCertificateCustomValidationCallback #2212

stevejgordon opened this issue Nov 2, 2023 · 0 comments · Fixed by #2213
Assignees
Labels
agent-dotnet bug Something isn't working
Milestone

Comments

@stevejgordon
Copy link
Contributor

stevejgordon commented Nov 2, 2023

When using the agent with .NET Framework 4.6.2, the user may experience the following exception.

System.MissingMethodException: Method not found: 'Void System.Net.Http.HttpClientHandler.set_ServerCertificateCustomValidationCallback(System.Func`5<System.Net.Http.HttpRequestMessage,System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,Boolean>)'.

This API is technically missing (see also) from .NET Framework 4.6.2, despite being in netstandard2.0.

This doesn't appear at compile time due to the build picking up a specific system.net.http package (see #2112). It can sometimes be worked around with binding redirects but this is not always possible in no-code instrumentation scenarios.

Options:

The easiest option, for now, would be removing the certificate callback code on net462 as this shouldn't impact many/any consumers and should avoid the exception.

References:

@stevejgordon stevejgordon added the bug Something isn't working label Nov 2, 2023
@stevejgordon stevejgordon self-assigned this Nov 2, 2023
@stevejgordon stevejgordon added this to the 8.11 milestone Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-dotnet bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant