Skip to content

Commit

Permalink
Prevent server certificate callback runtime exception (#2213)
Browse files Browse the repository at this point in the history
* Prevent server certificate callback runtime exception

On .NET Full framework <4.7.2, HttpClientHandler.ServerCertificateCustomValidationCallback is not available. Due to dependency binding issues introduced with netstandard,
the incorrect System.Net.Http package may be resolved and lead to exceptions at runtime.

This fix prevents calling this API on net462 targets which includes any .NET Framework version < .NET 4.7.2.

This introduces the net472 target so that we can resume using this API from that version, where it was included in the box.

* Update documentation

* Tweak docs
  • Loading branch information
stevejgordon authored and apmmachine committed Nov 21, 2023
1 parent 704e3e3 commit 0af2724
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions docs/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,12 @@ Verification can be disabled by changing this setting to false.
| `true` | Boolean
|============

[NOTE]
====
This configuration setting has no effect on .NET Framework versions 4.6.2-4.7.1.
We recommend upgrading to .NET Framework 4.7.2 or newer to use this configuration setting.
====

[float]
[[config-server-cert]]
==== `ServerCert` (added[1.9])
Expand All @@ -726,6 +732,12 @@ the trust store, such as a self-signed certificate.
| `<none>` | String
|============

[NOTE]
====
This configuration setting has no effect on .NET Framework versions 4.6.2-4.7.1.
We recommend upgrading to .NET Framework 4.7.2 or newer to use this configuration setting.
====

[float]
[[config-flush-interval]]
==== `FlushInterval` (added[1.1])
Expand Down
4 changes: 3 additions & 1 deletion docs/setup-auto-instrumentation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This approach works with the following

|x64

|.NET Framework 4.6.2+
|.NET Framework 4.6.2+*

.NET Core 2.1+

Expand All @@ -31,6 +31,8 @@ This approach works with the following
.NET 5+
|===

_* Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility._

NOTE: The Profiler based agent only supports 64-bit applications. 32-bit applications aren't supported.

It instruments the following assemblies:
Expand Down
10 changes: 9 additions & 1 deletion docs/supported-technologies.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ the agent will not capture transactions.
=== .NET versions

The agent works on every .NET flavor and version that supports .NET Standard 2.0.
This means .NET Core 2.0 or newer, and .NET Framework 4.6.2 or newer.
This means .NET Core 2.0 or newer, and .NET Framework 4.6.2* or newer.

_* Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility._

[IMPORTANT]
====
While this library *should* work on .NET Core 2.0+, we limit our support to only those
versions currently supported by Microsoft - .NET 6.0 and newer.
====

[float]
[[supported-web-frameworks]]
Expand Down

0 comments on commit 0af2724

Please sign in to comment.