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:
@ -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;
|
||||
|
Reference in New Issue
Block a user