Merge pull request #158 from brentru/remove-fingerprint-8266
Remove SSL for ESP8266 Platform
This commit is contained in:
commit
a2b63fcca9
7 changed files with 36 additions and 16 deletions
4
.github/workflows/githubci.yml
vendored
4
.github/workflows/githubci.yml
vendored
|
|
@ -26,10 +26,12 @@ jobs:
|
|||
run: bash ci/actions_install.sh
|
||||
|
||||
|
||||
# manually install WiFi
|
||||
# manually install WiFi and HTTPClient
|
||||
- name: extra libraries
|
||||
run: |
|
||||
git clone --quiet https://github.com/adafruit/WiFiNINA.git /home/runner/Arduino/libraries/WiFiNINA
|
||||
rm -rf /home/runner/Arduino/libraries/ArduinoHttpClient
|
||||
git clone --quiet https://github.com/arduino-libraries/ArduinoHttpClient.git /home/runner/Arduino/libraries/ArduinoHttpClient
|
||||
|
||||
- name: test platforms
|
||||
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||

|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
## Documentation
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name=Adafruit IO Arduino
|
||||
version=4.2.0
|
||||
version=4.2.1
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <adafruitio@adafruit.com>
|
||||
sentence=Arduino library to access Adafruit IO.
|
||||
|
|
|
|||
|
|
@ -873,6 +873,7 @@ char **parse_csv(const char *line) {
|
|||
continue;
|
||||
case '\0':
|
||||
fEnd = 1;
|
||||
continue;
|
||||
case ',':
|
||||
*tptr = '\0';
|
||||
*bptr = strdup(tmp);
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
#ifndef ADAFRUITIO_DEFINITIONS_H_
|
||||
#define ADAFRUITIO_DEFINITIONS_H_
|
||||
|
||||
#define ADAFRUITIO_VERSION_MAJOR 3 ///< Adafruit IO Arduino Major Semvar
|
||||
#define ADAFRUITIO_VERSION_MINOR 5 ///< Adafruit IO Arduino Minor Semvar
|
||||
#define ADAFRUITIO_VERSION_PATCH 0 ///< Adafruit IO Arduino Patch Semvar
|
||||
#define ADAFRUITIO_VERSION_MAJOR 4 ///< Adafruit IO Arduino Major Semvar
|
||||
#define ADAFRUITIO_VERSION_MINOR 2 ///< Adafruit IO Arduino Minor Semvar
|
||||
#define ADAFRUITIO_VERSION_PATCH 1 ///< Adafruit IO Arduino Patch Semvar
|
||||
|
||||
// forward declaration
|
||||
class AdafruitIO_Data;
|
||||
|
|
@ -125,14 +125,14 @@ public:
|
|||
///< Fingerprint
|
||||
|
||||
#define AIO_FEED_NAME_LENGTH \
|
||||
258 ///< Maximum length of an Adafruit IO Feed \
|
||||
///< Name; 128 + 1 + 128 for the group, a dot \
|
||||
///< , and actual feed name.
|
||||
258 ///< Maximum length of an Adafruit IO Feed: Name; 128 + 1 + 128 for the
|
||||
///< group, a dot, and actual feed name.
|
||||
|
||||
#define AIO_DATA_LENGTH \
|
||||
45 ///< Maximum length of data sent/recieved from Adafruit IO
|
||||
#define AIO_CSV_LENGTH \
|
||||
AIO_FEED_NAME_LENGTH + 4 ///< Maximum comma-separated-value length from \
|
||||
///< Adafruit IO
|
||||
AIO_FEED_NAME_LENGTH + \
|
||||
4 ///< Maximum comma-separated-value length from Adafruit IO
|
||||
|
||||
/** aio_status_t offers 13 status states */
|
||||
typedef enum {
|
||||
|
|
|
|||
|
|
@ -21,9 +21,13 @@ AdafruitIO_ESP8266::AdafruitIO_ESP8266(const char *user, const char *key,
|
|||
: AdafruitIO(user, key) {
|
||||
_ssid = ssid;
|
||||
_pass = pass;
|
||||
_client = new WiFiClientSecure;
|
||||
_client->setFingerprint(AIO_SSL_FINGERPRINT);
|
||||
_mqtt = new Adafruit_MQTT_Client(_client, _host, _mqtt_port);
|
||||
// Uncomment the following lines and remove the existing WiFiClient and MQTT
|
||||
// client constructors to use Secure MQTT with ESP8266.
|
||||
// _client = new WiFiClientSecure;
|
||||
// _client->setFingerprint(AIO_SSL_FINGERPRINT);
|
||||
// _mqtt = new Adafruit_MQTT_Client(_client, _host, _mqtt_port);
|
||||
_client = new WiFiClient;
|
||||
_mqtt = new Adafruit_MQTT_Client(_client, _host, 1883);
|
||||
_http = new HttpClient(*_client, _host, _http_port);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,17 @@
|
|||
#include "Adafruit_MQTT_Client.h"
|
||||
#include "Arduino.h"
|
||||
#include "ESP8266WiFi.h"
|
||||
#include "WiFiClientSecure.h"
|
||||
/* NOTE - Projects that require "Secure MQTT" (TLS/SSL) also require a new
|
||||
* SSL certificate every year. If adding Secure MQTT to your ESP8266 project is
|
||||
* important - please switch to using the modern ESP32 (and related models)
|
||||
* instead of the ESP8266 to avoid updating the SSL fingerprint every year.
|
||||
*
|
||||
* If you've read through this and still want to use "Secure MQTT" with your
|
||||
* ESP8266 project, we've left the "WiFiClientSecure" lines commented out. To
|
||||
* use them, uncomment the commented out lines within `AdafruitIO_ESP8266.h` and
|
||||
* `AdafruitIO_ESP8266.cpp` and recompile the library.
|
||||
*/
|
||||
// #include "WiFiClientSecure.h"
|
||||
|
||||
class AdafruitIO_ESP8266 : public AdafruitIO {
|
||||
|
||||
|
|
@ -40,7 +50,10 @@ protected:
|
|||
|
||||
const char *_ssid;
|
||||
const char *_pass;
|
||||
WiFiClientSecure *_client;
|
||||
WiFiClient *_client;
|
||||
// Uncomment the following line, and remove the line above, to use
|
||||
// secure MQTT with ESP8266.
|
||||
// WiFiClientSecure *_client;
|
||||
};
|
||||
|
||||
#endif // ESP8266
|
||||
|
|
|
|||
Loading…
Reference in a new issue