Skip to content

Commit 5021d47

Browse files
authored
Merge pull request #293 from brentru/remove-8266-ssl-fingerprint
Remove SSL for ESP8266 Build
2 parents e558e3b + 2d85cdd commit 5021d47

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit WipperSnapper
2-
version=1.0.0-beta.41
2+
version=1.0.0-beta.42
33
author=Adafruit
44
maintainer=Adafruit <adafruitio@adafruit.com>
55
sentence=Arduino client for Adafruit.io WipperSnapper

src/Wippersnapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#endif
6161

6262
#define WS_VERSION \
63-
"1.0.0-beta.41" ///< WipperSnapper app. version (semver-formatted)
63+
"1.0.0-beta.42" ///< WipperSnapper app. version (semver-formatted)
6464

6565
// Reserved Adafruit IO MQTT topics
6666
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic

src/network_interfaces/Wippersnapper_ESP8266.h

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,20 @@
2424
#include "ESP8266WiFi.h"
2525
#include "Wippersnapper.h"
2626

27-
static const char *fingerprint PROGMEM =
28-
"59 3C 48 0A B1 8B 39 4E 0D 58 50 47 9A 13 55 60 CC A0 1D AF";
29-
static const char *fingerprint_staging PROGMEM =
30-
"A0 A4 61 E0 D6 F8 94 FF FA C1 F2 DC 09 23 72 E1 "
31-
"CC 23 CD 64"; ///< AIO Staging SSL Fingerprint
27+
/* NOTE - Projects that require "Secure MQTT" (TLS/SSL) also require a new
28+
* SSL certificate every year. If adding Secure MQTT to your ESP8266 project is
29+
* important - please switch to using the modern ESP32 (and related models)
30+
* instead of the ESP8266 to avoid updating the SSL fingerprint every year.
31+
*
32+
* If you've read through this and still want to use "Secure MQTT" with your
33+
* ESP8266 project, we've left the "WiFiClientSecure" lines commented out. To
34+
* use them, uncomment the commented out lines within this file and re-compile
35+
* the library.
36+
*/
37+
// static const char *fingerprint PROGMEM = "59 3C 48 0A B1 8B 39 4E 0D 58 50 47
38+
// 9A 13 55 60 CC A0 1D AF"; static const char *fingerprint_staging PROGMEM =
39+
// "A0 A4 61 E0 D6 F8 94 FF FA C1 F2 DC 09 23 72 E1 CC 23 CD 64"; ///< AIO
40+
// Staging SSL Fingerprint
3241

3342
extern Wippersnapper WS;
3443

@@ -57,7 +66,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
5766
Wippersnapper_ESP8266() : Wippersnapper() {
5867
_ssid = 0;
5968
_pass = 0;
60-
_wifi_client = new WiFiClientSecure;
69+
_wifi_client = new WiFiClient;
6170
}
6271

6372
/**************************************************************************/
@@ -118,11 +127,14 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
118127
/*******************************************************************/
119128
void setupMQTTClient(const char *clientID) {
120129
_mqttBrokerURL = "io.adafruit.com";
121-
_wifi_client->setFingerprint(fingerprint);
122130

123-
WS._mqtt =
124-
new Adafruit_MQTT_Client(_wifi_client, _mqttBrokerURL, _mqtt_port,
125-
clientID, WS._username, WS._key);
131+
// Uncomment the following lines to use MQTT/SSL. You will need to
132+
// re-compile after. _wifi_client->setFingerprint(fingerprint); WS._mqtt =
133+
// new Adafruit_MQTT_Client(_wifi_client, _mqttBrokerURL, _mqtt_port,
134+
// clientID, WS._username, WS._key);
135+
136+
WS._mqtt = new Adafruit_MQTT_Client(_wifi_client, _mqttBrokerURL, 1883,
137+
clientID, WS._username, WS._key);
126138
}
127139

128140
/********************************************************/
@@ -156,7 +168,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
156168
const char *_ssid = NULL;
157169
const char *_pass = NULL;
158170
const char *_mqttBrokerURL = NULL;
159-
WiFiClientSecure *_wifi_client;
171+
WiFiClient *_wifi_client;
160172

161173
/**************************************************************************/
162174
/*!

0 commit comments

Comments
 (0)