212 Commits

Author SHA1 Message Date
igor.udot
daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
Aditya Patwardhan
61f992a061 Merge branch 'contrib/github_pr_15291' into 'master'
fix(esp_http_client): Fix invalid content length header (GitHub PR)

Closes IDFGH-14528

See merge request espressif/esp-idf!37036
2025-02-25 13:03:12 +08:00
Bernhard Heinloth
f31a0f7f61 fix(esp_http_client): Fix host header for IPv6 address literal
An IPv6 IP that occurs in the 'Host:' header of an HTTP request must be enclosed
in square brackets (RFC3986 section 3.2.2).

Searches for ':' in the host string to efficiently determine if the host is an
IPv6 IP address.
2025-02-19 10:41:05 +01:00
gaoxu
5ef4f20778 feat(esp32h21): disable unsupported build test 2025-02-06 15:47:51 +08:00
Christopher Durand
c0590f5b50 fix(esp_http_client): Fix invalid content length header
In case a request with no content is sent after one with the content
length header set the header of the previous request is sent with the
subsequent one.
For instance, an empty GET request after a PUT request will still
indicate the non-zero content length of the previous request.

This is fixed by clearing the content length header when it shouldn't be
set.
2025-01-27 12:09:23 +01:00
Mahavir Jain
89a96905c4
fix(esp_https_ota): handle invalid range condition for OTA resumption case 2025-01-23 17:13:43 +05:30
Mahavir Jain
d75ca966c3 Merge branch 'fix/revert_and_update_depricated_marked_private_api' into 'master'
fix(esp_http_client): Revert Deprecated Tag on Previously Marked Private API

See merge request espressif/esp-idf!36451
2025-01-21 14:02:19 +08:00
nilesh.kale
783ff22ebf fix(esp_http_client): update code format for API
This commit update code format as per IDF standard for API
esp_http_client_get_and_clear_last_tls_error().
2025-01-21 10:24:33 +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
nilesh.kale
f638090179 fix(esp_http_client): Revert Deprecated Tag on Previously Marked Private API
This commit removes depcriacted tag marked on priavte APIs'
http_utils_get_string_between() and http_utils_get_string_after().
As these are not publick API, necessary changes been applied on these
APIs' directly withput adding new similar one and marking them as depricated.
2025-01-16 17:20:27 +05:30
Mahavir Jain
24be422240 Merge branch 'bugfix/missing-esp-goto-on-false-debug' into 'master'
fix: Fixed missing macros declarations in esp_check.h

See merge request espressif/esp-idf!36352
2025-01-16 17:06:37 +08:00
Mahavir Jain
dcb43e0eff
fix(esp_common): move some DEBUG macros to http client component
In commit a0bcffcc, some ESP_RETURN and ESP_GOTO debug macros were
introduced. But this caused a regression with CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT
case. Its better to move this macros to HTTP client component itself, as
the debug log is still desired for the specific use-case.
2025-01-16 10:27:54 +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
d065cc5ce4 fix(esp_http_client): fixed memory leak issue while preparing HTTP digest authentication
This commit avoid memory leak while preparing basic HTTP digest
authentication.
Closes https://github.com/espressif/esp-idf/issues/14885
2024-12-31 15:03:06 +05:30
Mahavir Jain
706a445782 Merge branch 'bugfix/update_macro_defination_for_mem_check' into 'master'
fix(esp_http_client): Enhance MEM_CHECK Macro to Include Memory Allocation Failure Logs and Safe Handling

See merge request espressif/esp-idf!33453
2024-12-23 16:08:57 +08:00
nilesh.kale
92027a9039 fix(esp_http_client): updated API esp_http_client_get_url to get URL in correct format
This commit updates the API to include the port number in the URL,
which was previously missing.
2024-12-18 12:00:55 +05:30
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
8d8b3fc0a2 fix(esp_http_client): Fix ota failure with openssl server
If the TLS server (e.g., openssl) closes connection with encrypted close-notify alert
then `errno` is not explicitly set on the socket by LwIP stack.
For this scenario, we must rely only on `ERR_TCP_TRANSPORT_CONNECTION_CLOSED_BY_FIN`
return value as the connection close case and do the graceful connection closure.

Closes https://github.com/espressif/esp-idf/issues/14724
2024-10-15 16:37:32 +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
Serhii Kulyk
c87cb854f3 fix(http): fix invalid content-length header in http get 2024-08-29 00:14:49 +02:00
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
wanlei
3cf069c7d8 feat(esp32c61): disable unsupported build test 2024-07-16 16:06:19 +08:00
fbp2m
adb307da29
fix: fixed allocating if_name in client context multiple times
Do not allocate client->if_name twice in esp_http_client_init().

Signed-off-by: Harshit Malpani <harshit.malpani@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/13945
2024-06-19 11:39:56 +05:30
Mahavir Jain
a3dff04cf3 Merge branch 'bugfix/fix_resetting_redirect_counter' into 'master'
fix: reset redirect counter for using same handler

Closes IDFGH-12636 and IDFGH-12667

See merge request espressif/esp-idf!30395
2024-05-10 12:02:36 +08:00
Harshit Malpani
1ac2ebbeb9
fix: Add config option to set timeout for posting events
Event posting to the event loop should not hinder the working of
HTTP Client or HTTP Server. This commit add a config option to set
the timeout for posting the events to the loop.

Closes https://github.com/espressif/esp-idf/issues/13641
2024-05-08 11:41:05 +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
laokaiyao
65b1fd33d3 ci(esp32c5mp): disable the unsupported tests 2024-04-07 12:13:29 +08:00
Harshit Malpani
2814b5a330
Revert "fix(esp_http_client): Call event_handler after header value is received"
This reverts commit 04ac8e43dbaf37e42452fef034606ae3f04e644b.

When `http_on_header_event` is called, event_handler is invoked and
then the current header key and header value are freed. In the previous
approach, `http_on_header_event` was called from `http_on_header_value`,
but it lead to an issue where if the value is received in multiple chunks,
then the current header key and value were freed and thus header was not
processed correctly which might result in connection issues. Calling
`http_on_heaher_event` from `http_on_header_field` ensures that the current
header field and value are processed properly

Fixes https://github.com/espressif/esp-idf/issues/13497
Fixes https://github.com/espressif/esp-idf/issues/13097
2024-04-01 13:41:47 +05:30
Marius Vikhammer
1f7c666701 ci(test_apps): limit dependencies for misc test_apps
Only pull in direct dependencies for the test apps, reducing build time
as well making it possible for CI to determine if the test should run or not
when dependencies are changed.
2024-02-18 16:01:58 +08:00
Harshit Malpani
bc901c0a3a
fix(esp_http_client): Fix http digest auth without qop
Closes https://github.com/espressif/esp-idf/issues/12962
2024-01-23 12:22:35 +05:30
jim
14a9e01931 esp_http_client: Fix reset errno to 0 before call esp_transport_read
Closes https://github.com/espressif/esp-idf/issues/9020
2023-12-22 10:54:40 +08:00
Harshit Malpani
803ad150cf
feat(esp_http_client): SHA256 support in digest auth
Added support for using SHA256 algorithm while calculating
digest auth in HTTP client connection

Closes https://github.com/espressif/esp-idf/issues/12383
2023-12-15 11:32:57 +05:30
Shinichi Tanaka
c5cb67d49c
fix(esp_http_client): correct the typo in the error log string
Corrected the module name in the error log.
("https_ota" to "http_client")
2023-12-14 09:21:24 +09:00
David Čermák
096d1ce1bb Merge branch 'feat/http_client_session_ticket' into 'master'
feat(http_client): Restore TLS session and custom transport

See merge request espressif/esp-idf!26059
2023-12-01 15:11:20 +08:00
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
61d4775027
fix(esp_http_client): Fix esp_http_client async mode
Closes https://github.com/espressif/esp-idf/issues/12358
2023-11-06 13:13:15 +05:30
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
04ac8e43db
fix(esp_http_client): Call event_handler after header value is received 2023-09-25 12:27:54 +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
Mahavir Jain
bd0eac77b2 Merge branch 'feature/add_support_for_ds_peripheral_on_ota' into 'master'
feat(esp_http_client): Added support for OTA using ds peripheral for TLS

See merge request espressif/esp-idf!25713
2023-09-11 16:36:58 +08:00
Harshit Malpani
692e1a9e61
feat: ECDSA peripheral while performing http connection with mutual auth 2023-09-08 12:22:41 +05:30
David Cermak
7c012e3fe1 fix(http_client): Set common tcp config to both TCP and SSL transport
Foundation transport contained TCP properties for both TCP and SSL
transport, so it was enough to set the TCP connection properties
(keepalive, interface binding) to one transport only. After merging
5778a7c7 we have separate TCP properties for these transports and need
to set the same for both.
This commit also fixes unnecessary allocation of 1 more byte for if_name

Closes https://github.com/espressif/esp-protocols/issues/322
2023-09-07 08:33:44 +02:00
Aditya Patwardhan
4be9bc4e2e feat(esp_http_client): Added support for OTA using ds peripheral for TLS 2023-09-04 09:00:03 +05:30
Armando
7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
Harshit Malpani
8d95e45c05
fix: nitpick in esp_http_client 2023-08-02 13:48:14 +05:30