Skip to content

Commit

Permalink
Preliminary support for OTA over HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
xoseperez committed Feb 5, 2018
1 parent 3f46b87 commit 088543b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/espurna/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ PROGMEM const char* const custom_reset_string[] = {
// -----------------------------------------------------------------------------

#define OTA_PORT 8266 // OTA port
#define OTA_GITHUB_FP "D79F076110B39293E349AC89845B0380C19E2F8B"

// -----------------------------------------------------------------------------
// NOFUSS
Expand Down
9 changes: 8 additions & 1 deletion code/espurna/ota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 088543b

Please sign in to comment.