Skip to content

Commit

Permalink
Merge pull request #501 from pennam/esp32-fix-bundle
Browse files Browse the repository at this point in the history
ESP32: fix certificate bundle loading using core > 3.0.4
  • Loading branch information
pennam authored Aug 13, 2024
2 parents 6ef7ad8 + 87b0ff5 commit 12e9def
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);
#else
setCACertBundle(x509_crt_bundle, sizeof(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);
#else
setCACertBundle(x509_crt_bundle, sizeof(x509_crt_bundle));
#endif
#elif defined(ARDUINO_ARCH_ESP8266)
setInsecure();
#endif
Expand Down

0 comments on commit 12e9def

Please sign in to comment.