esp_https_ota.rst 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ESP HTTPS OTA
  2. =============
  3. Overview
  4. --------
  5. ``esp_https_ota`` provides simplified APIs to perform firmware upgrades over HTTPS.
  6. It's an abstraction layer over existing OTA APIs.
  7. Application Example
  8. -------------------
  9. .. highlight:: c
  10. ::
  11. esp_err_t do_firmware_upgrade()
  12. {
  13. esp_http_client_config_t config = {
  14. .url = CONFIG_FIRMWARE_UPGRADE_URL,
  15. .cert_pem = (char *)server_cert_pem_start,
  16. };
  17. esp_err_t ret = esp_https_ota(&config);
  18. if (ret == ESP_OK) {
  19. esp_restart();
  20. } else {
  21. return ESP_FAIL;
  22. }
  23. return ESP_OK;
  24. }
  25. .. only:: esp32
  26. Signature Verification
  27. ----------------------
  28. For additional security, signature of OTA firmware images can be verified. For that, refer :ref:`secure-ota-updates`
  29. API Reference
  30. -------------
  31. .. include-build-file:: inc/esp_https_ota.inc