You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just want to help others as it took me several days to figure out the problem why TSL worked fine with MQTT protocoll but did not work via websockets.
In case of .net Framework 4.6.2and older it is required to set DontEnableSchUseStrongCrypto=false
for example in C# code via System.AppContext.SetSwitch("Switch.System.Net.DontEnableSchUseStrongCrypto", false);
This is default in .net Framework 4.7 and newer: see https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls
I had to add an Logger to catch the exceptions information and forward it into Visual Studio Debug console so to understand what is going wrong here.
Adding the logger is as simple as implementing a small class and add it to the MqttFactory constructor.
Here a simple logger for debugging (not intented to use for real production code of course as it would lower the performance):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Just want to help others as it took me several days to figure out the problem why TSL worked fine with MQTT protocoll but did not work via websockets.
In case of .net Framework 4.6.2 and older it is required to set DontEnableSchUseStrongCrypto=false
for example in C# code via System.AppContext.SetSwitch("Switch.System.Net.DontEnableSchUseStrongCrypto", false);
This is default in .net Framework 4.7 and newer: see https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls
I had to add an Logger to catch the exceptions information and forward it into Visual Studio Debug console so to understand what is going wrong here.
Adding the logger is as simple as implementing a small class and add it to the MqttFactory constructor.
Here a simple logger for debugging (not intented to use for real production code of course as it would lower the performance):
Beta Was this translation helpful? Give feedback.
All reactions