Skip to content

Commit ffb7925

Browse files
committed
ESP32: fix certificate bundle loading using core > 3.0.4
1 parent 6ef7ad8 commit ffb7925

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: src/tls/utility/TLSClientMqtt.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ void TLSClientMqtt::begin(ConnectionHandler & connection) {
6060
*/
6161
(void)connection;
6262
#elif defined(ARDUINO_ARCH_ESP32)
63-
setCACertBundle(x509_crt_bundle);
63+
#if (ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4))
64+
setCACertBundle(x509_crt_bundle, sizeof(x509_crt_bundle));
65+
#else
66+
setCACertBundle(x509_crt_bundle);
67+
#endif
6468
#elif defined(ARDUINO_ARCH_ESP8266)
6569
setInsecure();
6670
#endif

Diff for: src/tls/utility/TLSClientOta.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ void TLSClientOta::begin(ConnectionHandler &connection) {
5656
*/
5757
(void)connection;
5858
#elif defined(ARDUINO_ARCH_ESP32)
59-
setCACertBundle(x509_crt_bundle);
59+
#if (ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4))
60+
setCACertBundle(x509_crt_bundle, sizeof(x509_crt_bundle));
61+
#else
62+
setCACertBundle(x509_crt_bundle);
63+
#endif
6064
#elif defined(ARDUINO_ARCH_ESP8266)
6165
setInsecure();
6266
#endif

0 commit comments

Comments
 (0)