Skip to content

Commit a2b63fc

Browse files
authored
Merge pull request #158 from brentru/remove-fingerprint-8266
Remove SSL for ESP8266 Platform
2 parents f6d762f + 3aa5e68 commit a2b63fc

7 files changed

+36
-16
lines changed

.github/workflows/githubci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ jobs:
2626
run: bash ci/actions_install.sh
2727

2828

29-
# manually install WiFi
29+
# manually install WiFi and HTTPClient
3030
- name: extra libraries
3131
run: |
3232
git clone --quiet https://github.com/adafruit/WiFiNINA.git /home/runner/Arduino/libraries/WiFiNINA
33+
rm -rf /home/runner/Arduino/libraries/ArduinoHttpClient
34+
git clone --quiet https://github.com/arduino-libraries/ArduinoHttpClient.git /home/runner/Arduino/libraries/ArduinoHttpClient
3335
3436
- name: test platforms
3537
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
![AIOArduino](https://cdn-learn.adafruit.com/assets/assets/000/057/496/original/adafruit_io_AIOA.png?1531335660)
88

9-
This library provides a simple device independent interface for interacting with [Adafruit IO](https://io.adafruit.com) using Arduino. It allows you to switch between WiFi (ESP8266, ESP32, ESP32-S2, Airlift, WINC1500, & WICED), Cellular (32u4 FONA), and Ethernet (Ethernet FeatherWing).
9+
This library provides a simple device independent interface for interacting with [Adafruit IO](https://io.adafruit.com) using Arduino. It allows you to switch between WiFi (ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3, Airlift, WINC1500, & WICED), Cellular (32u4 FONA), and Ethernet (Ethernet FeatherWing).
1010

1111
## Documentation
1212

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit IO Arduino
2-
version=4.2.0
2+
version=4.2.1
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino library to access Adafruit IO.

src/AdafruitIO_Data.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ char **parse_csv(const char *line) {
873873
continue;
874874
case '\0':
875875
fEnd = 1;
876+
continue;
876877
case ',':
877878
*tptr = '\0';
878879
*bptr = strdup(tmp);

src/AdafruitIO_Definitions.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#ifndef ADAFRUITIO_DEFINITIONS_H_
1717
#define ADAFRUITIO_DEFINITIONS_H_
1818

19-
#define ADAFRUITIO_VERSION_MAJOR 3 ///< Adafruit IO Arduino Major Semvar
20-
#define ADAFRUITIO_VERSION_MINOR 5 ///< Adafruit IO Arduino Minor Semvar
21-
#define ADAFRUITIO_VERSION_PATCH 0 ///< Adafruit IO Arduino Patch Semvar
19+
#define ADAFRUITIO_VERSION_MAJOR 4 ///< Adafruit IO Arduino Major Semvar
20+
#define ADAFRUITIO_VERSION_MINOR 2 ///< Adafruit IO Arduino Minor Semvar
21+
#define ADAFRUITIO_VERSION_PATCH 1 ///< Adafruit IO Arduino Patch Semvar
2222

2323
// forward declaration
2424
class AdafruitIO_Data;
@@ -125,14 +125,14 @@ class AdafruitIOGroupCallback {
125125
///< Fingerprint
126126

127127
#define AIO_FEED_NAME_LENGTH \
128-
258 ///< Maximum length of an Adafruit IO Feed \
129-
///< Name; 128 + 1 + 128 for the group, a dot \
130-
///< , and actual feed name.
128+
258 ///< Maximum length of an Adafruit IO Feed: Name; 128 + 1 + 128 for the
129+
///< group, a dot, and actual feed name.
130+
131131
#define AIO_DATA_LENGTH \
132132
45 ///< Maximum length of data sent/recieved from Adafruit IO
133133
#define AIO_CSV_LENGTH \
134-
AIO_FEED_NAME_LENGTH + 4 ///< Maximum comma-separated-value length from \
135-
///< Adafruit IO
134+
AIO_FEED_NAME_LENGTH + \
135+
4 ///< Maximum comma-separated-value length from Adafruit IO
136136

137137
/** aio_status_t offers 13 status states */
138138
typedef enum {

src/wifi/AdafruitIO_ESP8266.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ AdafruitIO_ESP8266::AdafruitIO_ESP8266(const char *user, const char *key,
2121
: AdafruitIO(user, key) {
2222
_ssid = ssid;
2323
_pass = pass;
24-
_client = new WiFiClientSecure;
25-
_client->setFingerprint(AIO_SSL_FINGERPRINT);
26-
_mqtt = new Adafruit_MQTT_Client(_client, _host, _mqtt_port);
24+
// Uncomment the following lines and remove the existing WiFiClient and MQTT
25+
// client constructors to use Secure MQTT with ESP8266.
26+
// _client = new WiFiClientSecure;
27+
// _client->setFingerprint(AIO_SSL_FINGERPRINT);
28+
// _mqtt = new Adafruit_MQTT_Client(_client, _host, _mqtt_port);
29+
_client = new WiFiClient;
30+
_mqtt = new Adafruit_MQTT_Client(_client, _host, 1883);
2731
_http = new HttpClient(*_client, _host, _http_port);
2832
}
2933

src/wifi/AdafruitIO_ESP8266.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@
2222
#include "Adafruit_MQTT_Client.h"
2323
#include "Arduino.h"
2424
#include "ESP8266WiFi.h"
25-
#include "WiFiClientSecure.h"
25+
/* NOTE - Projects that require "Secure MQTT" (TLS/SSL) also require a new
26+
* SSL certificate every year. If adding Secure MQTT to your ESP8266 project is
27+
* important - please switch to using the modern ESP32 (and related models)
28+
* instead of the ESP8266 to avoid updating the SSL fingerprint every year.
29+
*
30+
* If you've read through this and still want to use "Secure MQTT" with your
31+
* ESP8266 project, we've left the "WiFiClientSecure" lines commented out. To
32+
* use them, uncomment the commented out lines within `AdafruitIO_ESP8266.h` and
33+
* `AdafruitIO_ESP8266.cpp` and recompile the library.
34+
*/
35+
// #include "WiFiClientSecure.h"
2636

2737
class AdafruitIO_ESP8266 : public AdafruitIO {
2838

@@ -40,7 +50,10 @@ class AdafruitIO_ESP8266 : public AdafruitIO {
4050

4151
const char *_ssid;
4252
const char *_pass;
43-
WiFiClientSecure *_client;
53+
WiFiClient *_client;
54+
// Uncomment the following line, and remove the line above, to use
55+
// secure MQTT with ESP8266.
56+
// WiFiClientSecure *_client;
4457
};
4558

4659
#endif // ESP8266

0 commit comments

Comments
 (0)