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
I'm currently writing code samples for the MKR family - using my intermediate dev skills. I've successfully managed to connect using SSL on MKR NB, now I'm porting the code on MKR1000.
I'm trying to connect to Live Objects, and I'm having trouble with TLS on MKR1000.
I've been trying a bare sketch (from the ArduinoMQTTClient examples) to test the connection (below), and the MQTT client gives up with a -2 error code (connection refused). Working just fine without the WiFiSSLClient.
Usually, the cert is not included in the default set (it's the DigiCert Global Root CA). The certificate to use is RSA 2048 / SHA (256 but not sure: available here + screenshot below). However I don't really know if the correct cert is uploaded in the chip when using the FW update utility, as you can only provide the server URL (maybe it's getting the cert from the the homepage...).
I didn't find any cert files in the WiFi101 lib to tweak, which could have been a workaround (not so easily reproducible for beginners).
NB: Even if deprecated, TLS v1 and v1.1 are still functional.
MQTTS endpoint supports the following cipher suites:
-TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 for TLS v1.2 only (recommended)
-TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
-TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
-TLS_RSA_WITH_AES_128_GCM_SHA256 for TLS v1.2 only
-TLS_RSA_WITH_AES_128_CBC_SHA
-TLS_RSA_WITH_AES_256_CBC_SHA
Based on this elements and the capabilities of the latest Wi-Fi FW (I'm using version 19.6.1), should the library and MKR1000 be handle the connection?
Any help much appreciated ;)
#include <ArduinoMqttClient.h>
#include <WiFi101.h>
#include "arduino_secrets.h"
WiFiSSLClient wifiClient;
MqttClient mqttClient(wifiClient);
const char broker[] = "liveobjects.orange-business.com";
int port = 8883;
void setup() {
Serial.begin(9600);
Serial.println("Attempting to connect to Wi-Fi");
while (WiFi.begin(SECRET_SSID, SECRET_PASS) != WL_CONNECTED) {
Serial.print(".");
delay(5000);
}
Serial.println("You're connected to the network");
Serial.println();
mqttClient.setId("MKR1000");
mqttClient.setUsernamePassword("json+device", SECRET_MQTT_PASS);
Serial.print("Attempting to connect to the MQTT broker: ");
Serial.println(broker);
if (!mqttClient.connect(broker, port)) {
Serial.print("MQTT connection failed! Error code = ");
Serial.println(mqttClient.connectError());
while (1);
}
Serial.println("You're connected to the MQTT broker!");
Serial.println();
}
void loop() {
mqttClient.poll();
delay(1000);
}
The text was updated successfully, but these errors were encountered:
Hi guys,
I'm currently writing code samples for the MKR family - using my intermediate dev skills. I've successfully managed to connect using SSL on MKR NB, now I'm porting the code on MKR1000.
I'm trying to connect to Live Objects, and I'm having trouble with TLS on MKR1000.
I've been trying a bare sketch (from the ArduinoMQTTClient examples) to test the connection (below), and the MQTT client gives up with a
-2
error code (connection refused). Working just fine without theWiFiSSLClient
.Usually, the cert is not included in the default set (it's the DigiCert Global Root CA). The certificate to use is RSA 2048 / SHA (256 but not sure: available here + screenshot below). However I don't really know if the correct cert is uploaded in the chip when using the FW update utility, as you can only provide the server URL (maybe it's getting the cert from the the homepage...).
I didn't find any cert files in the WiFi101 lib to tweak, which could have been a workaround (not so easily reproducible for beginners).
Also, the server documentation says:
NB: Even if deprecated, TLS v1 and v1.1 are still functional.
Based on this elements and the capabilities of the latest Wi-Fi FW (I'm using version 19.6.1), should the library and MKR1000 be handle the connection?
Any help much appreciated ;)
The text was updated successfully, but these errors were encountered: