Skip to content

Commit 6d0d5ed

Browse files
committed
Using insecure mode with ESP8266 which makes the ESP accept any certificate without verification and therefore susceptible to MITM attacks. This has been a mgmt decision since the other option would have been that the ESPs will not be able to connect to the ArduinoIoTCloud anymore when the leaf certificate is exchanged (which happens once/year or even sooner than that). Unfortunately the ESP8266 does not have the capability to verify the whole chain of trust which is the reason why the verification of the leaf certificate has been the option used in the first place - despite breaking minimum once/year.
1 parent 35cd41c commit 6d0d5ed

File tree

3 files changed

+1
-67
lines changed

3 files changed

+1
-67
lines changed

src/ArduinoIoTCloud.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#ifdef BOARD_HAS_ECCX08
2121
#include "utility/ECCX08Cert.h"
2222
#include <ArduinoECCX08.h>
23-
#elif defined(BOARD_ESP)
24-
#include "utility/Certificate.h"
2523
#endif
2624

2725
#ifdef ARDUINO_ARCH_SAMD
@@ -62,7 +60,6 @@ ArduinoIoTCloudClass::ArduinoIoTCloudClass() :
6260
_thing_id(""),
6361
_sslClient(NULL),
6462
#ifdef BOARD_ESP
65-
_certificate(MQTTS_UP_ARDUINO_CC_CERTIFICATE),
6663
_password(""),
6764
#endif
6865
_mqttClient(NULL),
@@ -154,7 +151,7 @@ int ArduinoIoTCloudClass::begin(Client& net, String brokerAddress, uint16_t brok
154151
_sslClient->setEccSlot(keySlot, ECCX08Cert.bytes(), ECCX08Cert.length());
155152
#elif defined(BOARD_ESP)
156153
_sslClient = new WiFiClientSecure();
157-
_sslClient->setTrustAnchors(&_certificate);
154+
_sslClient->setInsecure();
158155
#endif
159156

160157
_mqttClient = new MqttClient(*_sslClient);

src/ArduinoIoTCloud.h

-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ class ArduinoIoTCloudClass {
228228
BearSSLClient *_sslClient;
229229
#elif defined(BOARD_ESP)
230230
WiFiClientSecure *_sslClient;
231-
X509List _certificate;
232231
String _password;
233232
#endif
234233

src/utility/Certificate.h

-62
This file was deleted.

0 commit comments

Comments
 (0)