From 0fd97f652a870f89b33f47e8b746a2b651df2db6 Mon Sep 17 00:00:00 2001 From: Lio DongMiao Date: Thu, 7 Mar 2024 08:28:44 +0000 Subject: [PATCH] context: fall back if no build-time mbedtls version --- lib/core/context.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/context.c b/lib/core/context.c index 94ffb7600..cdbcec883 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -785,7 +785,16 @@ lws_create_context(const struct lws_context_creation_info *info) #endif /* network */ #if defined(LWS_WITH_MBEDTLS) - lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, MBEDTLS_VERSION_STRING, opts_str, s); + { + char mbedtls_version[32]; + +#if defined(MBEDTLS_VERSION_C) + mbedtls_version_get_string(mbedtls_version); +#else + lws_snprintf(mbedtls_version, sizeof(mbedtls_version), "%s", MBEDTLS_VERSION_STRING); +#endif + lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, mbedtls_version, opts_str, s); + } #else lwsl_cx_notice(context, "LWS: %s, %s%s", library_version, opts_str, s); #endif