Skip to content

Commit e2fbdd7

Browse files
committed
TLS work:
* namespac etls * Portable tls::context * OpenSSL implementation and library * WolfSSL and OpenSSL adopt tls::context data
1 parent 8a62bae commit e2fbdd7

File tree

18 files changed

+3687
-228
lines changed

18 files changed

+3687
-228
lines changed

CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,28 @@ if (WolfSSL_FOUND)
208208
target_compile_definitions(boost_corosio_wolfssl PUBLIC BOOST_COROSIO_HAS_WOLFSSL)
209209
endif ()
210210

211+
#-------------------------------------------------
212+
#
213+
# OpenSSL
214+
#
215+
#-------------------------------------------------
216+
find_package(OpenSSL)
217+
if (OpenSSL_FOUND)
218+
file(GLOB_RECURSE BOOST_COROSIO_OPENSSL_HEADERS CONFIGURE_DEPENDS
219+
"${CMAKE_CURRENT_SOURCE_DIR}/include/boost/corosio/openssl/*.hpp")
220+
file(GLOB_RECURSE BOOST_COROSIO_OPENSSL_SOURCES CONFIGURE_DEPENDS
221+
"${CMAKE_CURRENT_SOURCE_DIR}/src/openssl/src/*.hpp"
222+
"${CMAKE_CURRENT_SOURCE_DIR}/src/openssl/src/*.cpp")
223+
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/corosio/openssl" PREFIX "include" FILES ${BOOST_COROSIO_OPENSSL_HEADERS})
224+
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/src/openssl/src" PREFIX "src" FILES ${BOOST_COROSIO_OPENSSL_SOURCES})
225+
add_library(boost_corosio_openssl ${BOOST_COROSIO_OPENSSL_HEADERS} ${BOOST_COROSIO_OPENSSL_SOURCES})
226+
add_library(Boost::corosio_openssl ALIAS boost_corosio_openssl)
227+
boost_corosio_setup_properties(boost_corosio_openssl)
228+
target_link_libraries(boost_corosio_openssl PUBLIC boost_corosio)
229+
target_link_libraries(boost_corosio_openssl PRIVATE OpenSSL::SSL OpenSSL::Crypto)
230+
target_compile_definitions(boost_corosio_openssl PUBLIC BOOST_COROSIO_HAS_OPENSSL)
231+
endif ()
232+
211233
#-------------------------------------------------
212234
#
213235
# Tests

doc/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
** xref:tutorials/echo-server.adoc[Echo Server]
55
** xref:tutorials/http-client.adoc[HTTP Client]
66
** xref:tutorials/dns-lookup.adoc[DNS Lookup]
7+
** xref:tutorials/tls-context.adoc[TLS Context Configuration]
78
* Guide
89
** xref:guide/tcp-networking.adoc[TCP/IP Networking]
910
** xref:guide/concurrent-programming.adoc[Concurrent Programming]

doc/modules/ROOT/pages/guide/tls.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It wraps an existing stream (like `socket`) and provides encrypted I/O.
1515
NOTE: Code snippets assume:
1616
[source,cpp]
1717
----
18-
#include <boost/corosio/wolfssl_stream.hpp>
18+
#include <boost/corosio/tls/wolfssl_stream.hpp>
1919
#include <boost/corosio/socket.hpp>
2020
2121
namespace corosio = boost::corosio;

doc/modules/ROOT/pages/tutorials/http-client.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ To make HTTPS requests, wrap the socket in a `wolfssl_stream`:
217217

218218
[source,cpp]
219219
----
220-
#include <boost/corosio/wolfssl_stream.hpp>
220+
#include <boost/corosio/tls/wolfssl_stream.hpp>
221221
222222
capy::task<void> run_https_client(
223223
corosio::io_context& ioc,

0 commit comments

Comments
 (0)