diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 715dc2d3..d376a2d4 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -446,6 +446,7 @@ PROGMEM const char* const custom_reset_string[] = { // ----------------------------------------------------------------------------- #define OTA_PORT 8266 // OTA port +#define OTA_GITHUB_FP "D79F076110B39293E349AC89845B0380C19E2F8B" // ----------------------------------------------------------------------------- // NOFUSS diff --git a/code/espurna/ota.ino b/code/espurna/ota.ino index 391da4fd..9164fe69 100644 --- a/code/espurna/ota.ino +++ b/code/espurna/ota.ino @@ -31,7 +31,14 @@ void _otaFrom(const char * url) { #endif ESPhttpUpdate.rebootOnUpdate(false); - t_httpUpdate_return ret = ESPhttpUpdate.update(url); + t_httpUpdate_return ret; + if (strncmp(url, "https", 5) == 0) { + String fp = getSetting("otafp", OTA_GITHUB_FP); + DEBUG_MSG_P(PSTR("[OTA] Using fingerprint: '%s'\n"), fp.c_str()); + ret = ESPhttpUpdate.update(url, APP_VERSION, fp.c_str()); + } else { + ret = ESPhttpUpdate.update(url, APP_VERSION); + } switch(ret) {