aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/tls/openssl/CMakeLists.txt
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-10-19 10:40:26 -0700
committerGarrett D'Amore <garrett@damore.org>2025-10-19 19:16:30 -0700
commit611c4acdddab9d702d235c2bcfe3b69002e93569 (patch)
tree6a1065c07db8eb01cd4be0a436e9375ad3979b90 /src/supplemental/tls/openssl/CMakeLists.txt
parent29769c0c3623a023eb12edb378b19116f64ee5b7 (diff)
downloadnng-611c4acdddab9d702d235c2bcfe3b69002e93569.tar.gz
nng-611c4acdddab9d702d235c2bcfe3b69002e93569.tar.bz2
nng-611c4acdddab9d702d235c2bcfe3b69002e93569.zip
Add support for OpenSSL v3.5 and newer.
We are *only* supporting 3.5 (or newer 3.x releases) as its the newest LTS version of OpenSSL. This supports the full set of TLS features with NNG, including DTLS, PSK, TLS 1.3, etc. Future work will explore making using of the QUIC support in OpenSSL. Note that this OpenSSL work sits on top of NNG's TCP streams, so it cannot benefit from Linux in-kernel TLS or other features such as TCP fast open at this time.
Diffstat (limited to 'src/supplemental/tls/openssl/CMakeLists.txt')
-rw-r--r--src/supplemental/tls/openssl/CMakeLists.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/supplemental/tls/openssl/CMakeLists.txt b/src/supplemental/tls/openssl/CMakeLists.txt
new file mode 100644
index 00000000..6cb70c03
--- /dev/null
+++ b/src/supplemental/tls/openssl/CMakeLists.txt
@@ -0,0 +1,32 @@
+#
+# Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+#
+include(FindThreads)
+
+if (NNG_TLS_ENGINE STREQUAL "openssl")
+ message(NOTICE "
+ ************************************************************
+ Linking against OpenSSL may change license terms.
+ Consult a lawyer and the license files for details.
+ ************************************************************")
+ nng_sources(openssl.c)
+
+ find_package(OpenSSL 3.5 REQUIRED)
+
+ if (OPENSSL_FOUND)
+ message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
+ target_include_directories(nng PRIVATE ${OPENSSL_INCLUDE_DIR})
+ target_include_directories(nng_testing PRIVATE ${OPENSSL_INCLUDE_DIR})
+ nng_link_libraries_public(PRIVATE ${OPENSSL_LIBRARIES})
+
+ endif()
+
+ nng_defines(NNG_SUPP_TLS)
+ nng_defines(NNG_SUPP_TLS_PSK)
+ nng_defines(NNG_TLS_ENGINE_OPENSSL)
+endif ()