Compare commits

...

6 Commits

Author SHA1 Message Date
Benjamin Sergeant
317e3c44bf
Update CHANGELOG.md 2021-10-22 11:10:42 -07:00
Benjamin Sergeant
61b90251af
Update IXWebSocketVersion.h 2021-10-22 11:09:12 -07:00
Benjamin Sergeant
851157f252
update api call 2021-10-22 10:59:51 -07:00
Benjamin Sergeant
69541cf750
define macro for mbedtls >= 3 2021-10-22 10:58:56 -07:00
Benjamin Sergeant
1e166eee57
cmake change find header file 2021-10-22 10:57:51 -07:00
Benjamin Sergeant
6860b2d09d
Fix mbedtls-3.0 problem
This cause CI to fail on macOS.

See this migration guide => https://github.com/ARMmbed/mbedtls/blob/development/docs/3.0-migration-guide.md
2021-10-22 10:22:57 -07:00
6 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,8 @@
find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h) find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)
# mbedtls-3.0 changed headers files, and we need to ifdef'out a few things
find_path(MBEDTLS_VERSION_GREATER_THAN_3 mbedtls/build_info.h)
find_library(MBEDTLS_LIBRARY mbedtls) find_library(MBEDTLS_LIBRARY mbedtls)
find_library(MBEDX509_LIBRARY mbedx509) find_library(MBEDX509_LIBRARY mbedx509)
find_library(MBEDCRYPTO_LIBRARY mbedcrypto) find_library(MBEDCRYPTO_LIBRARY mbedcrypto)

View File

@ -195,6 +195,11 @@ if (USE_TLS)
# This MBEDTLS_FOUND check is to help find a cmake manually configured MbedTLS # This MBEDTLS_FOUND check is to help find a cmake manually configured MbedTLS
if (NOT MBEDTLS_FOUND) if (NOT MBEDTLS_FOUND)
find_package(MbedTLS REQUIRED) find_package(MbedTLS REQUIRED)
if (MBEDTLS_VERSION_GREATER_THAN_3)
target_compile_definitions(ixwebsocket PRIVATE IXWEBSOCKET_USE_MBED_TLS_MIN_VERSION_3)
endif()
endif() endif()
target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${MBEDTLS_INCLUDE_DIRS}>) target_include_directories(ixwebsocket PUBLIC $<BUILD_INTERFACE:${MBEDTLS_INCLUDE_DIRS}>)
target_link_libraries(ixwebsocket ${MBEDTLS_LIBRARIES}) target_link_libraries(ixwebsocket ${MBEDTLS_LIBRARIES})

View File

@ -2,6 +2,10 @@
All changes to this project will be documented in this file. All changes to this project will be documented in this file.
## [11.3.1] - 2021-10-22
(library/cmake) Compatible with MbedTLS 3 + fix a bug on Windows where the incorrect remote port is computed (#320)
## [11.3.0] - 2021-09-20 ## [11.3.0] - 2021-09-20
(library/cmake) Only find OpenSSL, MbedTLS, zlib if they have not already been found, make CMake install optional (#317) + Use GNUInstallDirs in cmake (#318) (library/cmake) Only find OpenSSL, MbedTLS, zlib if they have not already been found, make CMake install optional (#317) + Use GNUInstallDirs in cmake (#318)

View File

@ -132,7 +132,11 @@ namespace ix
errMsg = "Cannot parse cert file '" + _tlsOptions.certFile + "'"; errMsg = "Cannot parse cert file '" + _tlsOptions.certFile + "'";
return false; return false;
} }
#ifdef IXWEBSOCKET_USE_MBED_TLS_MIN_VERSION_3
if (mbedtls_pk_parse_keyfile(&_pkey, _tlsOptions.keyFile.c_str(), "", mbedtls_ctr_drbg_random, &_ctr_drbg) < 0)
#else
if (mbedtls_pk_parse_keyfile(&_pkey, _tlsOptions.keyFile.c_str(), "") < 0) if (mbedtls_pk_parse_keyfile(&_pkey, _tlsOptions.keyFile.c_str(), "") < 0)
#endif
{ {
errMsg = "Cannot parse key file '" + _tlsOptions.keyFile + "'"; errMsg = "Cannot parse key file '" + _tlsOptions.keyFile + "'";
return false; return false;

View File

@ -13,7 +13,7 @@
#include <mbedtls/debug.h> #include <mbedtls/debug.h>
#include <mbedtls/entropy.h> #include <mbedtls/entropy.h>
#include <mbedtls/error.h> #include <mbedtls/error.h>
#include <mbedtls/net.h> #include <mbedtls/net_sockets.h>
#include <mbedtls/platform.h> #include <mbedtls/platform.h>
#include <mbedtls/x509.h> #include <mbedtls/x509.h>
#include <mbedtls/x509_crt.h> #include <mbedtls/x509_crt.h>

View File

@ -6,4 +6,4 @@
#pragma once #pragma once
#define IX_WEBSOCKET_VERSION "11.3.0" #define IX_WEBSOCKET_VERSION "11.3.1"