1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

esp32: fixes for mbedtls breakout

This commit is contained in:
Andy Green 2017-08-28 21:27:55 +08:00
parent ec5e0e3e51
commit 6d25763d10
3 changed files with 8 additions and 6 deletions

View file

@ -282,7 +282,7 @@ if (LWS_WITH_SSL AND LWS_USE_WOLFSSL)
endif()
if (LWS_WITH_SSL AND LWS_USE_MBEDTLS)
if ("${LWS_MBEDTLS_LIBRARIES}" STREQUAL "" OR "${LWS_MBEDTLS_INCLUDE_DIRS}" STREQUAL "")
if ("${LWS_MBEDTLS_LIBRARIES}" STREQUAL "" OR "${LWS_MBEDTLS_INCLUDE_DIRS}" STREQUAL "" AND NOT LWS_WITH_ESP32)
find_path(LWS_MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)
@ -302,9 +302,9 @@ if (LWS_WITH_SSL AND LWS_USE_MBEDTLS)
message(FATAL_ERROR "You must set LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS when LWS_USE_MBEDTLS is turned on.")
endif()
endif()
set(MBEDTLS_LIBRARIES ${LWS_MBEDTLS_LIBRARIES})
set(MBEDTLS_INCLUDE_DIRS ${LWS_MBEDTLS_INCLUDE_DIRS})
set(MBEDTLS_FOUND 1)
set(MBEDTLS_LIBRARIES ${LWS_MBEDTLS_LIBRARIES})
set(MBEDTLS_INCLUDE_DIRS ${LWS_MBEDTLS_INCLUDE_DIRS})
set(MBEDTLS_FOUND 1)
set(USE_MBEDTLS 1)
endif()
@ -608,7 +608,7 @@ if (NOT LWS_WITHOUT_CLIENT)
lib/client-parser.c)
endif()
if (LWS_USE_MBEDTLS)
if (LWS_USE_MBEDTLS AND NOT LWS_WITH_ESP32)
set(LWS_WITH_SSL ON)
list(APPEND HDR_PRIVATE

View file

@ -24,7 +24,7 @@ build:
-DBUILD_DIR_BASE=$(BUILD_DIR_BASE) \
-DCMAKE_TOOLCHAIN_FILE=$(COMPONENT_PATH)/cross-esp32.cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DOPENSSL_INCLUDE_DIR=${IDF_PATH}/components/openssl/include \
-DLWS_MBEDTLS_INCLUDE_DIRS=${IDF_PATH}/components/openssl/include \
-DLWS_WITH_STATS=0 \
-DZLIB_LIBRARY=$(BUILD_DIR_BASE)/zlib/libzlib.a \
-DZLIB_INCLUDE_DIR=$(COMPONENT_PATH)/../zlib \

View file

@ -273,7 +273,9 @@ lws_plat_get_peer_simple(struct lws *wsi, char *name, int namelen);
#define OPENSSL_NO_TLSEXT
#endif /* not USE_OLD_CYASSL */
#else
#if !defined(LWS_WITH_ESP32)
#include <openssl/ssl.h>
#endif
#if !defined(LWS_USE_MBEDTLS)
#include <openssl/evp.h>
#include <openssl/err.h>