This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 6ffd5c217753f5b4ee7643ba83f56c2c2e263479 Author: yangjianqing <[email protected]> AuthorDate: Tue Jul 22 15:32:24 2025 +0800 netutils/libwebsockets: make the CA certificate path configurable. Add CONFIG_NETUTILS_LIBWEBSOCKETS_CERTS (default /etc/ssl/certs) for the directory that TLS clients load trusted CA certificates from, and declare SSL_CTX_load_verify_file()/_dir(), which the OpenSSL-mbedTLS wrapper provides, so libwebsockets uses them to load the CA store. Signed-off-by: yangjianqing <[email protected]> Signed-off-by: makejian <[email protected]> Assisted-by: Kiro:claude-opus-4 --- netutils/libwebsockets/Kconfig | 8 ++++++++ netutils/libwebsockets/lws_config.h | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/netutils/libwebsockets/Kconfig b/netutils/libwebsockets/Kconfig index 96e876319..7fb3d7d56 100644 --- a/netutils/libwebsockets/Kconfig +++ b/netutils/libwebsockets/Kconfig @@ -57,6 +57,14 @@ config NETUTILS_LIBWEBSOCKETS_TLS wrapper. Requires CONFIG_OPENSSL_MBEDTLS_WRAPPER. When disabled, only plain ws:// connections are supported. +config NETUTILS_LIBWEBSOCKETS_CERTS + string "Default CA certificate path" + default "/etc/ssl/certs" + depends on NETUTILS_LIBWEBSOCKETS_TLS + ---help--- + File system path that libwebsockets loads trusted CA + certificates from when a client verifies the server. + endif if NETUTILS_LIBWEBSOCKETS_TEST diff --git a/netutils/libwebsockets/lws_config.h b/netutils/libwebsockets/lws_config.h index ec89d4faa..ea4da008b 100644 --- a/netutils/libwebsockets/lws_config.h +++ b/netutils/libwebsockets/lws_config.h @@ -144,9 +144,9 @@ /* #undef LWS_HAVE_SSL_CTX_get0_certificate */ -/* #undef LWS_HAVE_SSL_CTX_load_verify_file */ +#define LWS_HAVE_SSL_CTX_load_verify_file -/* #undef LWS_HAVE_SSL_CTX_load_verify_dir */ +#define LWS_HAVE_SSL_CTX_load_verify_dir /* #undef LWS_HAVE_SSL_CTX_set1_param */ @@ -188,7 +188,7 @@ /* #undef LWS_NO_CLIENT */ #define LWS_NO_DAEMONIZE #ifdef CONFIG_NETUTILS_LIBWEBSOCKETS_TLS -#define LWS_OPENSSL_CLIENT_CERTS "/etc/ssl/certs" +#define LWS_OPENSSL_CLIENT_CERTS CONFIG_NETUTILS_LIBWEBSOCKETS_CERTS #define LWS_OPENSSL_SUPPORT #endif /* #undef LWS_PLAT_OPTEE */
