Commit Graph

81 Commits

Author SHA1 Message Date
nilesh.kale
caf828dfaf fix(esp_http_client): Fix OTA failure with partial download enabled
This commit fixes an issue encountered during OTA when partial download
is enabled using an AWS signed URL restricted to GET requests.
It also adds an API to retrieve the OTA image size from the Content-Range header.
2025-06-30 11:18:26 +05:30
Mahavir Jain
a8bf745f23 Merge branch 'feat/adding_different_strategy_to_perform_tls_using_dynamic_feature' into 'master'
Add configuration to control dynamic buffer strategy in mbedtls

Closes IDF-12591

See merge request espressif/esp-idf!39469
2025-06-12 09:52:35 +05:30
hrushikesh.bhosale
5928a87aa7 feat(mbedtls): Add configuration to control dynamic buffer strategy in mbedtls
Problem:
1. In low-memory scenarios, the dynamic buffer feature can fail due to memory fragmentation.
2. It requires a contiguous 16KB heap chunk, but continuous allocation and deallocation of
the RX buffer can lead to fragmentation.
3. If another component allocates memory between these operations, it can break up the
available 16KB block, causing allocation failure.

Solution:
1. Introduce configurable strategy for using dynamic buffers in TLS connections.
2. For example, convert RX buffers to static after the TLS handshake.
3. Allow users to select the strategy via a new field in the esp_http_client_cfg_t structure.
4. The strategy can be controlled independently for each TLS session.
2025-06-05 12:43:47 +05:30
Richard Allen
30758d9beb feat(esp_http_client): Event to signal last header download
When parsing ND-JSON streams, this is needed to indicate the
point when the ND-JSON stream is considered open, which
occurs just after the last HTTP_EVENT_ON_HEADER.

ND-JSON stream clients cannot rely on the first HTTP_EVENT_ON_DATA,
since that is only triggered by an event, which are optional and
may never be sent, or only sent well after the last HTTP_EVENT_ON_HEADER.

Closes #15952
2025-05-28 08:50:28 -05:00
Mahavir Jain
f229a84578 Merge branch 'contrib/github_pr_15968' into 'master'
docs(esp_http_client): update return codes for open & perform (GitHub PR)

See merge request espressif/esp-idf!39239
2025-05-21 13:23:05 +05:30
Richard Allen
a0f085d012 docs(esp_http_client): update return codes for open & perform
Extend the return code section to include async return values.
2025-05-16 08:55:08 -05:00
hrushikesh.bhosale
846a5c42ae feat(esp_http_client): Allow the DER certificates in esp_http_client
- esp_http_client support just PEM ca_cert and client_cert.
- Although esp_tls supports both PEM and DER certificate. We have logic
based on cert_len and client_cert_len which decides whether given cert or client_cert
is in PEM or DER format.
- If length is 0 then it is PEM certificate and if length is passed then DER is
considered. This is true for both ca_cert and client_cert

This commits allow to pass the DER certificate in esp_http_client
2025-04-23 19:59:39 +08:00
Mahavir Jain
89a96905c4 fix(esp_https_ota): handle invalid range condition for OTA resumption case 2025-01-23 17:13:43 +05:30
Lorenzo Consolaro
30c2907962 feat(https): Get TLS errors from http client
update PR

update mr

Update components/esp_http_client/esp_http_client.c

Co-authored-by: Nilesh Kale <nilesh.kale@espressif.com>
2025-01-21 10:22:27 +05:30
Xu Si Yu
4be36fdb8b feat(tcp_transport): add an api to configure the addr family 2025-01-16 10:44:33 +08:00
nilesh.kale
a0bcffcce9 fix(esp_http_client): updated defination for macro mem_check
This commit replace macro MEM_CHECK with return on failure and
updated usage of reespctive APIs' in IDF.
This also update th prototype of API esp_http_client_add_auth().

Closes https://github.com/espressif/esp-idf/issues/14463
2024-12-10 15:41:36 +05:30
nilesh.kale
0733de565f feat(esp_htttps_ota): handle case if server retured 304 not_modified during ota
This commit handles case for response code 304 (NOT_MODIFIED) during ota.

Closes https://github.com/espressif/esp-idf/issues/14839
2024-12-02 17:23:30 +08:00
hrushikesh.bhosale
5aaa47834a feat(esp_http_client): Added ALPN feature in esp_http_client
Added the alpn field in esp_http_clinet_config_t struct. So
that user can modify from the esp_http_clinet component.
2024-11-15 14:37:28 +05:30
nilesh.kale
f9961fda62 fix(esp_http_client): added initial argument checking for APIs'
This MR added checks for arguments passed in APIS' of esp_http_client.c
2024-09-27 17:05:04 +05:30
Duco Sebel
73e1085e54 feat(esp_http_client): Add function to delete all headers set by 'esp_http_client_set_header' 2024-09-27 16:57:54 +05:30
hrushikesh.bhosale
52cd89698e feat(esp_http_client): Added http method REPORT
Added support http REPORT method and tested it using local server.
Added test case for REPOPRT method in esp_http_client_example.c
The URL(httpbin.org) does not support for /report endpoint.

Closes https://github.com/espressif/esp-idf/issues/14147
2024-07-23 16:43:33 +05:30
Harshit Malpani
1987f055c9 fix: reset redirect counter for using same handler
Closes https://github.com/espressif/esp-idf/issues/13633
2024-05-07 10:27:23 +05:30
David Cermak
96069eef3b feat(http_client): Add support for using custom tcp_transport 2023-11-29 20:48:40 +01:00
David Cermak
7e22a13afe feat(http_client): Add support for TLS session tickets 2023-11-29 20:48:35 +01:00
Harshit Malpani
27681a5073 fix(esp-tls): Use TLS 1.2 and TLS 1.3 simultaneously
This commit fixes the issue with TLS 1.2 connection when TLS 1.3 is
enabled in config.
2023-10-23 16:23:10 +05:30
Harshit Malpani
96a8316e71 feat(esp_http_client): Add API to set auth data
This new API can be used to set the authentication data in the client context
when the auth data is received in the custom header

Closes: https://github.com/espressif/esp-idf/pull/12131
2023-09-25 12:27:53 +05:30
Mahavir Jain
2b3418b4a0 Merge branch 'feature/use_ecdsa_perph_while_mutual_auth' into 'master'
feat: ECDSA peripheral while performing http connection with mutual auth

Closes IDF-7390

See merge request espressif/esp-idf!25052
2023-09-11 19:41:21 +08:00
Harshit Malpani
692e1a9e61 feat: ECDSA peripheral while performing http connection with mutual auth 2023-09-08 12:22:41 +05:30
Aditya Patwardhan
4be9bc4e2e feat(esp_http_client): Added support for OTA using ds peripheral for TLS 2023-09-04 09:00:03 +05:30
Mahavir Jain
bdf8f1c382 Merge branch 'contrib/github_pr_10715' into 'master'
Add user_data accessor and mutator to esp_http_client (GitHub PR)

Closes IDFGH-9337 and IDFGH-9221

See merge request espressif/esp-idf!22751
2023-03-21 14:07:31 +08:00
Andrew Clink
82cdcc5de5 Add user_data accessor and mutator to esp_http_client
Closes: https://github.com/espressif/esp-idf/pull/10715
2023-03-16 12:36:16 +05:30
Harshit Malpani
674fd8feb8 esp_http_client: Add support for esp_events 2023-03-15 11:48:11 +05:30
harshal.patil
32e78b71f3 http_client: fixed looping caused when disable_auto_redirect enabled
Closes https://github.com/espressif/esp-idf/issues/10629
2023-02-23 14:11:58 +05:30
Harshit Malpani
6de9e42122 esp_http_client: Add feature to cancel an HTTP request
Closes: https://github.com/espressif/esp-idf/issues/9892
2022-12-02 11:36:28 +05:30
Aditya Patwardhan
ba43063314 esp_http_client: Add option to use secure_element
Closes https://github.com/espressif/esp-idf/issues/10071
2022-11-17 14:43:35 +05:30
Aditya Patwardhan
4904d57fd9 esp_http_client: Added support to set server common name. 2022-09-13 05:31:43 +00:00
David Cermak
5c383d7b73 esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network
interface component.
Network interface drivers shall depend on esp_netif.
esp_netif shall depend on lwip (but not on any specific interface
driver) -- it optionally depends on vfs and esp_eth (need ethernet
header for L2/bridge mode)
2022-07-20 14:59:07 +02:00
Laukik Hase
7115881a97 esp_http_client/esp_https_ota: Removed errno checks
- Returned -ESP_ERR_HTTP_EAGAIN for timeout errors from
  esp_http_client whenever tcp transport layer returns
  connection timeout
- Removed redundant conditional statements as required

Co-authored-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2022-05-31 15:04:21 +05:30
Shubham Kulkarni
ec6f222625 esp_http_client: Add new status code 303 and 308 2022-03-21 04:27:43 +00:00
Laukik Hase
ca84d2d6c9 esp_http_client: Added event for HTTP redirect
- Allows users to manually intercept and process the HTTP redirection
 when disable_auto_redirect (from the esp_http_client handle) is set to true

Closes https://github.com/espressif/esp-idf/issues/8029
2022-01-12 11:40:32 +05:30
xutao
10377ce2ff esp_http_client: add a get HTTP client session errno api for esp_http_client 2021-11-24 17:23:09 +08:00
Shubham Kulkarni
5bf49e1cd6 esp_http_client: Support handling larger content lengths
Closes https://github.com/espressif/esp-idf/issues/6580
2021-10-29 18:14:22 +08:00
Jon Maloney
c8b7f7a5d3 esp_http_client: Support client key password for HTTPS connections.
Closes https://github.com/espressif/esp-idf/pull/7420
Closes https://github.com/espressif/esp-idf/issues/7418

Signed-off-by: Aditya Patwardhan <aditya.patwardhan@espressif.com>
2021-08-25 18:27:31 +05:30
yuanjm
02367b44ef esp_http_client: Fix when receive FIN, close the connection in internal.
Closes https://github.com/espressif/esp-idf/issues/7036
2021-07-23 12:16:17 +08:00
Shubham Kulkarni
3064487c20 esp_https_ota: Add check for HTTP error codes and corresponding error logs
Closes: https://github.com/espressif/esp-idf/issues/7058
2021-06-02 11:19:30 +00:00
Jan Brudny
967e057906 esp-tls, esp_http_client and esp_http_server: update copyright notice 2021-05-31 20:06:09 +08:00
0xFEEDC0DE64
0f3ad80a99 const corrections for esp_http_client_set_password()
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Closes: https://github.com/espressif/esp-idf/pull/6941
2021-05-10 13:03:09 +05:30
yuanjm
754ec7b278 esp_http_client: Add API to set http client timeout value
Closes https://github.com/espressif/esp-idf/issues/6984
2021-05-06 13:55:12 +08:00
Aditya Patwardhan
f66bdf1233 esp_http_client: Enable support of crt_bundle in esp_http_client 2021-04-07 05:31:21 +00:00
0xFEEDC0DE64
a9c6fbe8d3 Added cert and key length options
Closes https://github.com/espressif/esp-idf/pull/6556

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-03-23 11:58:35 +05:30
yuanjm
bead3599ab components: Support bind socket to specified interface in esp_http_client and esp_websocket_client component 2021-03-10 02:19:29 +00:00
Shubham Kulkarni
b53e46a68e Add options for esp_http_client and esp_websocket_client to support keepalive 2021-01-22 06:56:28 +00:00
Scott Shell
8c09fbf6f1 Make the UserAgent string in esp-http-client configurable
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6044
2020-11-19 14:43:14 +05:30
Shubham Kulkarni
83f4ebf852 esp_http_client: Skip check for redirection counter if status code is success.
Set disable_auto_redirect in esp_http_client example to validate this condition in CI
2020-11-19 14:43:14 +05:30
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00