3

我正在使用M2Mqtt.NET连接到AWS IoT broker. 当我尝试连接时,The client and server cannot communicate, because they do not possess a common algorithm发生异常。

代码:

//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

我尝试过的事情:

  • 检查并确认服务器正在运行TLS 1.2
  • 将两个证书都安装为受信任的
  • 创建新证书
  • 通过Resources文件使用证书
  • 在 HTTPS 上运行 Web 项目

项目设置:

  • ASP.NET MVC 项目

  • .NET 4.5.2

  • Windows 10 企业版 64 位(10.0,内部版本 10240)

4

0 回答 0