From 38846de92b37cb7f765d390c8506b5d3103e1605 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Fri, 26 Jan 2024 14:04:11 +0800 Subject: [PATCH 1/2] refactor(mbedtls): example https_mbedtls now runs on Linux --- examples/protocols/.build-test-rules.yml | 2 ++ examples/protocols/https_mbedtls/README.md | 4 ++-- .../https_mbedtls/main/https_mbedtls_example_main.c | 9 +-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/protocols/.build-test-rules.yml b/examples/protocols/.build-test-rules.yml index bd984dba60..ded39b8f25 100644 --- a/examples/protocols/.build-test-rules.yml +++ b/examples/protocols/.build-test-rules.yml @@ -101,6 +101,8 @@ examples/protocols/http_server/ws_echo_server: examples/protocols/https_mbedtls: <<: *default_dependencies + enable: + - if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux" disable: - if: IDF_TARGET == "esp32p4" temporary: true diff --git a/examples/protocols/https_mbedtls/README.md b/examples/protocols/https_mbedtls/README.md index f5ebb2cc2c..231bf1cf1c 100644 --- a/examples/protocols/https_mbedtls/README.md +++ b/examples/protocols/https_mbedtls/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | Linux | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | # HTTP server with TLS support using mbedTLS diff --git a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c index 32118ffad5..f6263dadbb 100644 --- a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c +++ b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c @@ -9,14 +9,13 @@ * * SPDX-License-Identifier: Apache-2.0 * - * SPDX-FileContributor: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2015-2024 Espressif Systems (Shanghai) CO LTD */ #include #include #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" #include "esp_system.h" @@ -24,12 +23,6 @@ #include "protocol_examples_common.h" #include "esp_netif.h" -#include "lwip/err.h" -#include "lwip/sockets.h" -#include "lwip/sys.h" -#include "lwip/netdb.h" -#include "lwip/dns.h" - #include "mbedtls/platform.h" #include "mbedtls/net_sockets.h" #include "mbedtls/esp_debug.h" From a04f8d7041ae43e3111c6e4ca044855c7236b530 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Fri, 26 Jan 2024 14:33:32 +0800 Subject: [PATCH 2/2] docs(mbedtls): Clarified example README --- examples/protocols/https_mbedtls/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/protocols/https_mbedtls/README.md b/examples/protocols/https_mbedtls/README.md index 231bf1cf1c..efb0ee90e8 100644 --- a/examples/protocols/https_mbedtls/README.md +++ b/examples/protocols/https_mbedtls/README.md @@ -1,11 +1,11 @@ | Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | Linux | | ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | ----- | -# HTTP server with TLS support using mbedTLS +# HTTP connection with TLS support using mbedTLS (See the README.md file in the upper level 'examples' directory for more information about examples.) -Simple HTTPS example that uses mbedTLS to establish a secure socket connection using the certificate bundle with two custom certificates added for verification: +Simple HTTPS request example that uses mbedTLS to establish a secure socket connection using the certificate bundle with two custom certificates added for verification: ## How to use example