Skip to content

Commit

Permalink
Revert CA checking
Browse files Browse the repository at this point in the history
  • Loading branch information
xperiments committed Jun 27, 2024
1 parent 586496d commit f91b851
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/xtouch/cloud.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class BambuCloud
String url = _region == "China" ? "https://api.bambulab.cn/v1/user-service/user/login" : "https://api.bambulab.com/v1/user-service/user/login";

HTTPClient http;
http.begin(url, getRegionCert());
// http.begin(url, getRegionCert());
http.begin(url);
http.addHeader("Content-Type", "application/json");

String payload = "{\"account\":\"" + _email + "\",\"password\":\"" + _password + "\"}";
Expand Down Expand Up @@ -178,7 +179,8 @@ class BambuCloud
String url = _region == "China" ? "https://api.bambulab.cn/v1/iot-service/api/user/bind" : "https://api.bambulab.com/v1/iot-service/api/user/bind";

HTTPClient http;
http.begin(url, getRegionCert());
// http.begin(url, getRegionCert());
http.begin(url);
http.addHeader("Authorization", "Bearer " + _auth_token);
http.addHeader("Content-Type", "application/json");

Expand Down Expand Up @@ -211,7 +213,8 @@ class BambuCloud
String url = (_region == "China") ? "https://api.bambulab.cn/v1/iot-service/api/slicer/setting?version=undefined" : "https://api.bambulab.com/v1/iot-service/api/slicer/setting?version=undefined";

HTTPClient http;
http.begin(url, getRegionCert());
// http.begin(url, getRegionCert());
http.begin(url);
http.addHeader("Authorization", "Bearer " + _auth_token);

int httpResponseCode = http.GET();
Expand Down
3 changes: 2 additions & 1 deletion src/xtouch/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,8 @@ void xtouch_mqtt_setup()
xtouch_wiFiClientSecure.flush();
xtouch_wiFiClientSecure.stop();

xtouch_wiFiClientSecure.setCACert(cloud.getRegion() == "China" ? cn_mqtt_bambulab_com : us_mqtt_bambulab_com);
// xtouch_wiFiClientSecure.setCACert(cloud.getRegion() == "China" ? cn_mqtt_bambulab_com : us_mqtt_bambulab_com);
xtouch_wiFiClientSecure.setInsecure();

xtouch_pubSubClient.setServer(cloud.getMqttCloudHost(), 8883);
xtouch_pubSubClient.setBufferSize(2048); // 2KB for mqtt message JWT output
Expand Down

0 comments on commit f91b851

Please sign in to comment.