M2Mqtt.NET. The client and server cannot communicate because they do not have a common algorithm

I am using M2Mqtt.NET to connect to . When I try to connect, an exception is thrown . AWS IoT brokerThe client and server cannot communicate, because they do not possess a common algorithm

The code:

//getting certificates from file
X509Certificate certRoot = X509Certificate.CreateFromCertFile("path/to/root.crt");
X509Certificate certClient = X509Certificate.CreateFromCertFile("path/to/client.crt");

//creating client
var mqttClient = new MqttClient("brokerAddress",
                                    8883,
                                    true,
                                    new X509Certificate(certRoot),
                                    new X509Certificate(certClient),
                                    MqttSslProtocols.TLSv1_2);

//connecting client-the problem line
mqttClient.Connect(AppConstants.CLIENT_ID); //GUID

Things I tried:

  • Checked and confirmed that the server is working TLS 1.2
  • Installed both certificates as trusted
  • Create new certificates
  • Using certificates through a Resourcesfile
  • Running a web project on HTTPS

Project setup:

  • ASP.NET MVC Project

  • .NET 4.5.2

  • Windows 10 Enterprise 64-bit (10.0, Build 10240)

+4
source share

Source: https://habr.com/ru/post/1661144/


All Articles