Skip to content

Conversation

@hoeken
Copy link
Contributor

@hoeken hoeken commented Nov 27, 2025

This PR adds optional support for using the ESP-IDF CA certificate bundle when running on Arduino-ESP32 3.x (ESP-IDF 5.x).

✅ New Feature: Bundled Certificate Support

A new configuration field enables usage of the built-in CA bundle:

esp32FOTA.useBundledCerts();

or

cfg.use_bundled_certs = true;

When enabled:

  • esp32FOTA attempts to load the ESP-IDF CA bundle via setCACertBundle()
  • A weak-symbol check detects whether the bundle is actually linked
  • If present, HTTPS requests use the full CA bundle
  • If not present, esp32FOTA safely falls back to the existing TLS behavior

✅ Fully Backwards Compatible

  • No changes to existing behavior unless the new option is explicitly enabled
  • Existing root_ca and unsafe modes continue to function normally
  • Compatible with both Arduino-ESP32 2.x and 3.x
  • Compatible with Arduino IDE and PlatformIO
  • No build-time dependency on the CA bundle unless the user links it

✅ Runtime-Safe Detection

Weak symbol declarations prevent build failures when the CA bundle is not available.
If the symbols are missing, esp32FOTA logs a message and falls back gracefully.

Summary

This PR introduces a secure, modern HTTPS configuration path using the ESP-IDF root certificate store, without breaking existing setups or requiring code changes for current users.

@tobozo
Copy link
Collaborator

tobozo commented Nov 27, 2025

thanks !

@tobozo tobozo merged commit f9059ba into chrisjoyce911:master Nov 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants