Closed muhaook closed 1 year ago
Since it repros under IIS it makes me wonder if it is related to domain-neutral, see this comment.
I am not sure if it is a domain-neutral issue. I did not see any assembly loading error in logs.
After googling, I tried to enable TLS 1.2 explicitly during initialization of auto-instrumentation. the issue seems fixed. But I am not sure if there are any side effects. Also, a question is whether we support TLS 1.2 in current auto-instrumentation, do we really need this fix?
+#if NETFRAMEWORK
+ string enableTls12 = System.Environment.GetEnvironmentVariable("ENABLE_TLS12");
+ if (string.IsNullOrEmpty(enableTls12) || enableTls12.Equals("true", StringComparison.OrdinalIgnoreCase))
+ {
+ System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
+ }
+#endif
I suggest checking if it cannot be configured on OS level. See: https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls
Found here: https://learn.microsoft.com/pl-pl/dotnet/fundamentals/code-analysis/quality-rules/ca5386
It makes sense, thanks. I experimented a little bit:
Logger.Information("System.Net.ServicePointManager.SecurityProtocol: " + System.Net.ServicePointManager.SecurityProtocol.ToString());
[2023-01-03T11:11:19.8575036Z] [Information] System.Net.ServicePointManager.SecurityProtocol: Ssl3, Tls
<httpRuntime targetFramework="4.6.2" />
[2023-01-03T11:18:08.9511968Z] [Information] System.Net.ServicePointManager.SecurityProtocol: Tls, Tls11, Tls12, Tls13
[2023-01-03T11:22:28.8355829Z] [Information] System.Net.ServicePointManager.SecurityProtocol: SystemDefault
I feel it is very helpful to have a log information to show current TLS support in dotnet-auto-instrumentation. I added it in Intiailize method; but it can be added to anywhere during dotnet-auto-instrumention initialization.
Logger.Information("System.Net.ServicePointManager.SecurityProtocol: " + System.Net.ServicePointManager.SecurityProtocol.ToString());
Bug Report
Symptom
Describe the bug OTLP exporter failed on .net framework 4.6.2 with errors:
OTLP exporter works on .net 6 for the same upload endpoint. So I think the backend should be good. it failed for some of my .net framework 4.6.2 samples hosted on IIS (webform/mvc/wcf). it succeeded for one of my console sample on .net framework 4.6.2.
Runtime environment:
otel-dotnet-auto-native-w3wp-1792.log WaimaiUi-2-133160873315949951-1792.log