Skip to content

Commit 0569125

Browse files
committed
Verify ALP server with Truststore
1 parent 64bd993 commit 0569125

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/alpdata.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "alpdata.h"
2828
#include "timeutils.h"
2929

30+
extern const uint8_t x509_crt_bundle_start[] asm("_binary_src_truststore_x509_crt_bundle_start");
31+
3032
/* Download http://alp.u-blox.com/current_14d.alp (ssl?) if there is a new one
3133
* Takes 5 seconds to update the data.
3234
*/
@@ -54,8 +56,10 @@ void AlpData::update(SSD1306DisplayDevice *display) {
5456
log_d("Existing file is from %s", lastModified.c_str());
5557
display->showTextOnGrid(0, 5, "ALP data...");
5658

59+
WiFiClientSecure wiFiClient;
60+
wiFiClient.setCACertBundle(x509_crt_bundle_start);
5761
HTTPClient httpClient;
58-
httpClient.begin(ALP_DOWNLOAD_URL);
62+
httpClient.begin(wiFiClient, ALP_DOWNLOAD_URL);
5963
const char *lastModifiedHeaderName = "Last-Modified";
6064
const char *headers[] = {lastModifiedHeaderName};
6165
httpClient.collectHeaders(headers, 1);

0 commit comments

Comments
 (0)