|
567 | 567 | #endif |
568 | 568 |
|
569 | 569 | // This is not working at the moment!! |
570 | | -// Requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core 2.4.0 |
| 570 | +// Requires SECURE_CLIENT = SECURE_CLIENT_AXTLS and ESP8266 Arduino Core 2.4.0 |
571 | 571 | #ifndef WEB_SSL_ENABLED |
572 | 572 | #define WEB_SSL_ENABLED 0 // Use HTTPS web interface |
573 | 573 | #endif |
|
839 | 839 | #endif |
840 | 840 |
|
841 | 841 |
|
842 | | -#ifndef MQTT_USE_ASYNC |
843 | | -#define MQTT_USE_ASYNC 1 // Use AysncMQTTClient (1) or PubSubClient (0) |
| 842 | +#ifndef MQTT_LIBRARY |
| 843 | +#define MQTT_LIBRARY MQTT_ASYNC // Choose between: MQTT_ASYNC (AysncMQTTClient), MQTT_PUBSUB (PubSubClient), MQTT_ARDUINO (Arduino-MQTT) |
844 | 844 | #endif |
845 | 845 |
|
846 | 846 | // MQTT OVER SSL |
847 | 847 | // Using MQTT over SSL works pretty well but generates problems with the web interface. |
848 | 848 | // It could be a good idea to use it in conjuntion with WEB_SUPPORT=0. |
849 | | -// Requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core 2.4.0. |
| 849 | +// Requires SECURE_CLIENT = SECURE_CLIENT_AXTLS or SECURE_CLIENT_BEARSSL and ESP8266 Arduino Core >= 2.4.0. |
850 | 850 | // |
851 | | -// You can use SSL with MQTT_USE_ASYNC=1 (AsyncMqttClient library) |
| 851 | +// You can use SSL with MQTT_LIBRARY=ASYNC (AsyncMqttClient library) |
852 | 852 | // but you might experience hiccups on the web interface, so my recommendation is: |
853 | 853 | // WEB_SUPPORT=0 |
854 | 854 | // |
855 | | -// If you use SSL with MQTT_USE_ASYNC=0 (PubSubClient library) |
| 855 | +// If you use SSL with MQTT_LIBRARY=PUBSUB (PubSubClient library) or MQTT_LIBRARY=ARDUINO (Arduino-MQTT library) |
856 | 856 | // you will have to disable all the modules that use ESPAsyncTCP, that is: |
857 | | -// ALEXA_SUPPORT=0, INFLUXDB_SUPPORT=0, TELNET_SUPPORT=0, THINGSPEAK_SUPPORT=0 and WEB_SUPPORT=0 |
| 857 | +// ALEXA_SUPPORT=0, INFLUXDB_SUPPORT=0, TELNET_SUPPORT=0, THINGSPEAK_SUPPORT=0, DEBUG_TELNET_SUPPORT=0 and WEB_SUPPORT=0 |
858 | 858 | // |
859 | | -// You will need the fingerprint for your MQTT server, example for CloudMQTT: |
860 | | -// $ echo -n | openssl s_client -connect m11.cloudmqtt.com:24055 > cloudmqtt.pem |
861 | | -// $ openssl x509 -noout -in cloudmqtt.pem -fingerprint -sha1 |
| 859 | +// You will need the fingerprint of your MQTT server, in order to prevent MITS attacks. |
| 860 | +// To get a certificate fingerprint, run the following command: |
| 861 | +// $ echo -n | openssl s_client -connect mqtt.googleapis.com:8883 2>&1 | openssl x509 -noout -fingerprint -sha1 | cut -d\= -f2 |
| 862 | +// Note that this fingerprint changes with e.g. LetsEncrypt renewals or when the CSR changes. |
| 863 | +// It's also possible to leave the fingerprint empty, the certificate is then always trusted. |
862 | 864 |
|
863 | 865 | #ifndef MQTT_SSL_ENABLED |
864 | 866 | #define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled |
|
868 | 870 | #define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server |
869 | 871 | #endif |
870 | 872 |
|
| 873 | +#ifndef MQTT_SECURE_CLIENT_CHECK |
| 874 | +#define MQTT_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK // Use global verification setting by default |
| 875 | +#endif |
| 876 | + |
| 877 | +#ifndef MQTT_SECURE_CLIENT_MFLN |
| 878 | +#define MQTT_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN // Use global MFLN setting by default |
| 879 | +#endif |
| 880 | + |
| 881 | +#ifndef MQTT_SECURE_CLIENT_INCLUDE_CA |
| 882 | +#define MQTT_SECURE_CLIENT_INCLUDE_CA 0 // Use user-provided CA. Only PROGMEM PEM option is supported. |
| 883 | + // When enabled, current implementation includes "static/mqtt_secure_client_ca.h" with |
| 884 | + // const char _mqtt_client_ca[] PROGMEM = "...PEM data..."; |
| 885 | + // By default, using LetsEncrypt X3 root in "static/letsencrypt_isrgroot_pem.h" |
| 886 | +#endif |
871 | 887 |
|
872 | 888 | #ifndef MQTT_ENABLED |
873 | 889 | #define MQTT_ENABLED 0 // Do not enable MQTT connection by default |
|
986 | 1002 | #define MQTT_TOPIC_DATETIME "datetime" |
987 | 1003 | #define MQTT_TOPIC_FREEHEAP "freeheap" |
988 | 1004 | #define MQTT_TOPIC_VCC "vcc" |
| 1005 | +#ifndef MQTT_TOPIC_STATUS |
989 | 1006 | #define MQTT_TOPIC_STATUS "status" |
| 1007 | +#endif |
990 | 1008 | #define MQTT_TOPIC_MAC "mac" |
991 | 1009 | #define MQTT_TOPIC_RSSI "rssi" |
992 | 1010 | #define MQTT_TOPIC_MESSAGE_ID "id" |
|
1031 | 1049 |
|
1032 | 1050 |
|
1033 | 1051 | #define MQTT_STATUS_ONLINE "1" // Value for the device ON message |
| 1052 | +#ifndef MQTT_STATUS_OFFLINE |
1034 | 1053 | #define MQTT_STATUS_OFFLINE "0" // Value for the device OFF message (will) |
| 1054 | +#endif |
1035 | 1055 |
|
1036 | 1056 | #define MQTT_ACTION_RESET "reboot" // RESET MQTT topic particle |
1037 | 1057 |
|
|
1283 | 1303 | // THINGSPEAK OVER SSL |
1284 | 1304 | // Using THINGSPEAK over SSL works well but generates problems with the web interface, |
1285 | 1305 | // so you should compile it with WEB_SUPPORT to 0. |
1286 | | -// When THINGSPEAK_USE_ASYNC is 1, requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core 2.4.0. |
| 1306 | +// When THINGSPEAK_USE_ASYNC is 1, requires SECURE_CLIENT = SECURE_CLIENT_AXTLS and ESP8266 Arduino Core >= 2.4.0. |
1287 | 1307 | #define THINGSPEAK_USE_SSL 0 // Use secure connection |
1288 | 1308 |
|
1289 | 1309 | #define THINGSPEAK_FINGERPRINT "78 60 18 44 81 35 BF DF 77 84 D4 0A 22 0D 9B 4E 6C DC 57 2C" |
|
0 commit comments