Skip to content

Commit

Permalink
ESP32: fix certificate bundle loading using core > 3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Aug 8, 2024
1 parent 6ef7ad8 commit ffb7925
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/tls/utility/TLSClientMqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ void TLSClientMqtt::begin(ConnectionHandler & connection) {
*/
(void)connection;
#elif defined(ARDUINO_ARCH_ESP32)
setCACertBundle(x509_crt_bundle);
#if (ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4))
setCACertBundle(x509_crt_bundle, sizeof(x509_crt_bundle));
#else
setCACertBundle(x509_crt_bundle);
#endif
#elif defined(ARDUINO_ARCH_ESP8266)
setInsecure();
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/tls/utility/TLSClientOta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ void TLSClientOta::begin(ConnectionHandler &connection) {
*/
(void)connection;
#elif defined(ARDUINO_ARCH_ESP32)
setCACertBundle(x509_crt_bundle);
#if (ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 4))
setCACertBundle(x509_crt_bundle, sizeof(x509_crt_bundle));
#else
setCACertBundle(x509_crt_bundle);
#endif
#elif defined(ARDUINO_ARCH_ESP8266)
setInsecure();
#endif
Expand Down

0 comments on commit ffb7925

Please sign in to comment.