paxexpress integration

This commit is contained in:
Michael Solinski 2021-03-04 16:02:24 +01:00
parent d9cdeddecf
commit 3c4b2218e4
3 changed files with 4 additions and 9 deletions

View File

@ -118,7 +118,7 @@ def publish_bintray(source, target, env):
firmware_path = str(source[0]) firmware_path = str(source[0])
firmware_name = basename(firmware_path) firmware_name = basename(firmware_path)
url = "/".join([ url = "/".join([
"https://api.bintray.com", "content", "https://pax.express", "content",
user, repository, package, version, firmware_name user, repository, package, version, firmware_name
]) ])

View File

@ -24,12 +24,9 @@
BintrayClient::BintrayClient(const String &user, const String &repository, const String &package) BintrayClient::BintrayClient(const String &user, const String &repository, const String &package)
: m_user(user), m_repo(repository), m_package(package), : m_user(user), m_repo(repository), m_package(package),
m_storage_host("dl.bintray.com"), m_storage_host("pax.express"),
m_api_host("api.bintray.com") m_api_host("pax.express")
{ {
m_certificates.emplace_back("cloudfront.net", CLOUDFRONT_API_ROOT_CA);
m_certificates.emplace_back("akamai.bintray.com", BINTRAY_AKAMAI_ROOT_CA);
m_certificates.emplace_back("bintray.com", BINTRAY_API_ROOT_CA);
} }
String BintrayClient::getUser() const String BintrayClient::getUser() const
@ -83,7 +80,7 @@ String BintrayClient::requestHTTPContent(const String &url) const
{ {
String payload; String payload;
HTTPClient http; HTTPClient http;
http.begin(url, getCertificate(url)); http.begin(url);
int httpCode = http.GET(); int httpCode = http.GET();
if (httpCode > 0) if (httpCode > 0)

View File

@ -150,7 +150,6 @@ int do_ota_update() {
WiFiClientSecure client; WiFiClientSecure client;
client.setCACert(bintray.getCertificate(currentHost));
client.setTimeout(RESPONSE_TIMEOUT_MS); client.setTimeout(RESPONSE_TIMEOUT_MS);
if (!client.connect(currentHost.c_str(), port)) { if (!client.connect(currentHost.c_str(), port)) {
@ -162,7 +161,6 @@ int do_ota_update() {
while (redirect) { while (redirect) {
if (currentHost != prevHost) { if (currentHost != prevHost) {
client.stop(); client.stop();
client.setCACert(bintray.getCertificate(currentHost));
if (!client.connect(currentHost.c_str(), port)) { if (!client.connect(currentHost.c_str(), port)) {
ESP_LOGI(TAG, "Redirect detected, but cannot connect to %s", ESP_LOGI(TAG, "Redirect detected, but cannot connect to %s",
currentHost.c_str()); currentHost.c_str());