Skip to content

Commit

Permalink
Support ENABLE_TLS_NATIVE_ROOTS to use system TLS CAs (#3660)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche authored Nov 2, 2024
1 parent 94c9556 commit 8184226
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
63 changes: 62 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/taskchampion-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ else()
add_subdirectory(${CMAKE_SOURCE_DIR}/src/taskchampion-cpp/corrosion)
endif()

OPTION (ENABLE_TLS_NATIVE_ROOTS "Use the system's TLS root certificates" OFF)

if (ENABLE_TLS_NATIVE_ROOTS)
message ("Enabling native TLS roots")
set(TASKCHAMPION_FEATURES "tls-native-roots")
endif (ENABLE_TLS_NATIVE_ROOTS)

# Import taskchampion-lib as a CMake library. This implements the Rust side of
# the cxxbridge, and depends on the `taskchampion` crate.
corrosion_import_crate(
MANIFEST_PATH "${CMAKE_SOURCE_DIR}/Cargo.toml"
LOCKED
CRATES "taskchampion-lib")
CRATES "taskchampion-lib"
FEATURES "${TASKCHAMPION_FEATURES}")

# Set up `taskchampion-cpp`, the C++ side of the bridge.
corrosion_add_cxxbridge(taskchampion-cpp
Expand Down
4 changes: 4 additions & 0 deletions src/taskchampion-cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ crate-type = ["staticlib"]
taskchampion = "0.9.0"
cxx = "1.0.124"

[features]
# use native CA roots, instead of bundled
tls-native-roots = ["taskchampion/tls-native-roots"]

[build-dependencies]
cxx-build = "1.0"

0 comments on commit 8184226

Please sign in to comment.