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:
X509Certificate certRoot = X509Certificate.CreateFromCertFile("path/to/root.crt");
X509Certificate certClient = X509Certificate.CreateFromCertFile("path/to/client.crt");
var mqttClient = new MqttClient("brokerAddress",
8883,
true,
new X509Certificate(certRoot),
new X509Certificate(certClient),
MqttSslProtocols.TLSv1_2);
mqttClient.Connect(AppConstants.CLIENT_ID);
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:
source
share