Browse Source

Preliminary support for OTA over HTTPS

softuart
Xose Pérez 6 years ago
parent
commit
088543b222
2 changed files with 9 additions and 1 deletions
  1. +1
    -0
      code/espurna/config/general.h
  2. +8
    -1
      code/espurna/ota.ino

+ 1
- 0
code/espurna/config/general.h View File

@ -446,6 +446,7 @@ PROGMEM const char* const custom_reset_string[] = {
// -----------------------------------------------------------------------------
#define OTA_PORT 8266 // OTA port
#define OTA_GITHUB_FP "D79F076110B39293E349AC89845B0380C19E2F8B"
// -----------------------------------------------------------------------------
// NOFUSS


+ 8
- 1
code/espurna/ota.ino View File

@ -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) {


Loading…
Cancel
Save