1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-23 08:45:22 +03:00

Basic authentication with ESP8266httpUpdate (#7190)

Add ability to use basic access authentication with ESP8266httpUpdate
This commit is contained in:
drhideg
2020-07-30 17:55:29 +02:00
committed by GitHub
parent 85ea47e9bc
commit d92e1edac8
3 changed files with 46 additions and 0 deletions

View File

@ -56,6 +56,7 @@ constexpr int HTTP_UE_SERVER_WRONG_HTTP_CODE = (-104);
constexpr int HTTP_UE_SERVER_FAULTY_MD5 = (-105);
constexpr int HTTP_UE_BIN_VERIFY_HEADER_FAILED = (-106);
constexpr int HTTP_UE_BIN_FOR_WRONG_FLASH = (-107);
constexpr int HTTP_UE_SERVER_UNAUTHORIZED = (-108);
enum HTTPUpdateResult {
HTTP_UPDATE_FAILED,
@ -111,6 +112,9 @@ public:
_ledOn = ledOn;
}
void setAuthorization(const String& user, const String& password);
void setAuthorization(const String& auth);
#if HTTPUPDATE_1_2_COMPATIBLE
// This function is deprecated, use rebootOnUpdate and the next one instead
t_httpUpdate_return update(const String& url, const String& currentVersion,
@ -174,6 +178,10 @@ protected:
int _lastError;
bool _rebootOnUpdate = true;
bool _closeConnectionsOnUpdate = true;
String _user;
String _password;
String _auth;
private:
int _httpClientTimeout;
followRedirects_t _followRedirects;