diff --git a/CMakeLists.txt b/CMakeLists.txt index f704f827..19093ac6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,12 +114,11 @@ if (WIN32) set(USE_MBED_TLS TRUE) endif() -set(USE_OPEN_SSL FALSE) if (USE_TLS) if (USE_MBED_TLS) list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketMbedTLS.h) list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketMbedTLS.cpp) - elseif (APPLE) + elseif (APPLE AND NOT USE_OPEN_SSL) list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketAppleSSL.h) list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketAppleSSL.cpp) elseif (WIN32) @@ -141,6 +140,8 @@ if (USE_TLS) target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_TLS) if (USE_MBED_TLS) target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_MBED_TLS) + elseif (USE_OPEN_SSL) + target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_OPEN_SSL) elseif (APPLE) elseif (WIN32) else() @@ -163,6 +164,13 @@ if (UNIX) endif() if (USE_TLS AND USE_OPEN_SSL) + + # Help finding Homebrew's OpenSSL on macOS + if (APPLE) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/openssl/lib) + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /usr/local/opt/openssl/include) + endif() + find_package(OpenSSL REQUIRED) add_definitions(${OPENSSL_DEFINITIONS}) message(STATUS "OpenSSL: " ${OPENSSL_VERSION}) diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 798e3899..dc0208ab 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -6.3.0 +6.3.1 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7464493f..e71003f8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [6.3.1] - 2019-09-29 + +- Add ability to use OpenSSL on apple platforms. + ## [6.3.0] - 2019-09-28 - ixcobra / fix crash in CobraConnection::publishNext when the queue is empty + handle CobraConnection_PublishMode_Batch in CobraMetricsThreadedPublisher diff --git a/ixwebsocket/IXSocketFactory.cpp b/ixwebsocket/IXSocketFactory.cpp index 8e10b730..26eb5c1c 100644 --- a/ixwebsocket/IXSocketFactory.cpp +++ b/ixwebsocket/IXSocketFactory.cpp @@ -10,12 +10,12 @@ #ifdef IXWEBSOCKET_USE_MBED_TLS #include -#elif __APPLE__ -#include #elif defined(_WIN32) #include #elif defined(IXWEBSOCKET_USE_OPEN_SSL) #include +#elif __APPLE__ +#include #endif #else @@ -42,12 +42,12 @@ namespace ix #ifdef IXWEBSOCKET_USE_TLS #if defined(IXWEBSOCKET_USE_MBED_TLS) socket = std::make_shared(tlsOptions); -#elif defined(__APPLE__) - socket = std::make_shared(tlsOptions); +#elif defined(IXWEBSOCKET_USE_OPEN_SSL) + socket = std::make_shared(tlsOptions); #elif defined(_WIN32) socket = std::make_shared(tlsOptions); -#else - socket = std::make_shared(tlsOptions); +#elif defined(__APPLE__) + socket = std::make_shared(tlsOptions); #endif #else errorMsg = "TLS support is not enabled on this platform."; diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 14d9b839..c7fadcbe 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "6.3.0" +#define IX_WEBSOCKET_VERSION "6.3.1" diff --git a/makefile b/makefile index 34b77cd6..53d85681 100644 --- a/makefile +++ b/makefile @@ -14,6 +14,9 @@ brew: ws: mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 -DUSE_MBED_TLS=1 .. ; make -j 4) +ws_openssl: + mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 -DUSE_OPEN_SSL=1 .. ; make -j 4) + uninstall: xargs rm -fv < build/install_manifest.txt @@ -64,6 +67,10 @@ test: mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 -DUSE_TEST=1 .. ; make -j 4) (cd test ; python2.7 run.py -r) +test_openssl: + mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_OPEN_SSL=1 -DUSE_WS=1 -DUSE_TEST=1 .. ; make -j 4) + (cd test ; python2.7 run.py -r) + ws_test: ws (cd ws ; env DEBUG=1 PATH=../ws/build:$$PATH bash test_ws.sh)