From 02178a8b5843a2c5a59fb7b104e4f9f5df1ff5ee Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 9 Nov 2017 14:09:14 -0800 Subject: fixes #3 TLS transport This introduces a new transport (compatible with the TLS transport from mangos), using TLS v1.2. To use the new transport, you must have the mbed TLS library available on your system (Xenial libmbedtls-dev). You can use version 2.x or newer -- 1.3.x and PolarSSL versions are not supported. You enable the TLS transport with -DNNG_TRANSPORT_TLS=ON in the CMake configuration. You must configure the server certificate by default, and this can only be done using nng options. See the nng_tls man page for details. This work is experimental, and was made possible by Capitar IT Group BV, and Staysail Systems, Inc. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cd49b9f..27f0321e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ include (CheckLibraryExists) include (CheckCSourceCompiles) include (GNUInstallDirs) +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + if (POLICY CMP0042) # Newer cmake on MacOS should use @rpath cmake_policy (SET CMP0042 NEW) @@ -170,6 +172,14 @@ option (NNG_TRANSPORT_ZEROTIER "Enable ZeroTier transport (requires libzerotierc if (NNG_TRANSPORT_ZEROTIER) add_definitions (-DNNG_HAVE_ZEROTIER) endif () + +option (NNG_TRANSPORT_TLS "Enable TLS transport (requires mbedtls)" OFF) +if (NNG_TRANSPORT_TLS) + set(NNG_MBEDTLS_ENABLE ON) + add_definitions (-DNNG_MBEDTLS_ENABLE) + add_definitions (-DNNG_HAVE_TLS) +endif() + # Platform checks. if (NNG_ENABLE_COVERAGE) -- cgit v1.2.3-70-g09d2