Skip to content

Commit a8f13bc

Browse files
authored
Merge pull request #632 from david-cermak/fix/ci_jobs
[CI]: Fixes with recent IDF updates
2 parents 6766be6 + aecf6f8 commit a8f13bc

File tree

7 files changed

+13
-39
lines changed

7 files changed

+13
-39
lines changed

.github/workflows/examples_build-host-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ jobs:
1414
strategy:
1515
matrix:
1616
idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3"]
17+
include:
18+
- idf_ver: "latest"
19+
warning: "Warning: The smallest app partition is nearly full"
1720
runs-on: ubuntu-22.04
1821
container: espressif/idf:${{ matrix.idf_ver }}
1922
steps:
2023
- name: Checkout esp-protocols
2124
uses: actions/checkout@v4
2225
- name: Build with IDF-${{ matrix.idf_ver }}
26+
env:
27+
EXPECTED_WARNING: ${{ matrix.warning }}
2328
shell: bash
2429
run: |
2530
. ${IDF_PATH}/export.sh

components/esp_websocket_client/examples/target/main/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ set(EMBED_FILES "") # Initialize an empty list for files to embed
1010
"certs/client_key.pem")
1111
#endif()
1212

13-
# For testing purpose we are using CA of wss://echo.websocket.events
14-
#if(CONFIG_WS_OVER_TLS_SERVER_AUTH)
15-
list(APPEND EMBED_FILES
16-
"certs/ca_certificate_public_domain.pem")
17-
#endif()
18-
1913
# Register the component with source files, include dirs, and any conditionally added embedded files
2014
idf_component_register(SRCS "${SRC_FILES}"
2115
INCLUDE_DIRS "${INCLUDE_DIRS}"

components/esp_websocket_client/examples/target/main/certs/ca_certificate_public_domain.pem

Lines changed: 0 additions & 30 deletions
This file was deleted.

components/esp_websocket_client/examples/target/main/websocket_example.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "nvs_flash.h"
2020
#include "esp_event.h"
2121
#include "protocol_examples_common.h"
22+
#include "esp_crt_bundle.h"
2223

2324
#include "freertos/FreeRTOS.h"
2425
#include "freertos/task.h"
@@ -159,8 +160,12 @@ static void websocket_app_start(void)
159160
websocket_cfg.client_key = key_start;
160161
websocket_cfg.client_key_len = key_end - key_start;
161162
#elif CONFIG_WS_OVER_TLS_SERVER_AUTH
162-
extern const char cacert_start[] asm("_binary_ca_certificate_public_domain_pem_start"); // CA cert of wss://echo.websocket.event, modify it if using another server
163-
websocket_cfg.cert_pem = cacert_start;
163+
// Using certificate bundle as default server certificate source
164+
websocket_cfg.crt_bundle_attach = esp_crt_bundle_attach;
165+
// If using a custom certificate it could be added to certificate bundle, added to the build similar to client certificates in this examples,
166+
// or read from NVS.
167+
/* extern const char cacert_start[] asm("ADDED_CERTIFICATE"); */
168+
/* websocket_cfg.cert_pem = cacert_start; */
164169
#endif
165170

166171
#if CONFIG_WS_OVER_TLS_SKIP_COMMON_NAME_CHECK

components/esp_websocket_client/examples/target/pytest_websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def send_data(self, data):
5252
def run(self):
5353
if self.use_tls is True:
5454
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
55-
ssl_context.load_cert_chain(certfile='main/certs/server_cert.pem', keyfile='main/certs/server_key.pem')
55+
ssl_context.load_cert_chain(certfile='main/certs/server/server_cert.pem', keyfile='main/certs/server/server_key.pem')
5656
if self.client_verify is True:
5757
ssl_context.load_verify_locations(cafile='main/certs/ca_cert.pem')
5858
ssl_context.verify = ssl.CERT_REQUIRED

0 commit comments

Comments
 (0)