summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSimon Warta <simon@kullo.net>2017-05-01 22:15:15 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-05-21 23:19:16 +0200
commit8256cce2c7ae2b13fc4790ab08623cee17ac612c (patch)
treec32d85dada399f6eec692fb2bca35624f36ef4dd /CMakeLists.txt
parent5606fcc657ecbe113b6dcdcd26e79e7fa7fbea42 (diff)
downloadcurl-8256cce2c7ae2b13fc4790ab08623cee17ac612c.tar.gz
cmake: add CURL_CA_BUNDLE/CURL_CA_FALLBACK/CURL_CA_PATH options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58d159e2c..a7c2f7400 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -623,6 +623,35 @@ else()
endif()
+#
+# CA handling
+#
+set(CURL_CA_BUNDLE "auto" CACHE STRING
+ "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
+set(CURL_CA_FALLBACK OFF CACHE BOOL
+ "Set ON to use built-in CA store of TLS backend. Defaults to OFF")
+set(CURL_CA_PATH "auto" CACHE STRING
+ "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
+
+if("${CURL_CA_BUNDLE}" STREQUAL "none")
+ unset(CURL_CA_BUNDLE CACHE)
+elseif("${CURL_CA_BUNDLE}" STREQUAL "auto")
+ # TODO: implement
+ message(SEND_ERROR "Auto mode not implemented for CURL_CA_BUNDLE")
+elseif("${CURL_CA_BUNDLE}" STREQUAL "")
+ message(SEND_ERROR "Invalid value of CURL_CA_BUNDLE. Use 'none', 'auto' or path.")
+endif()
+
+if("${CURL_CA_PATH}" STREQUAL "none")
+ unset(CURL_CA_PATH CACHE)
+elseif("${CURL_CA_PATH}" STREQUAL "auto")
+ # TODO: implement
+ message(SEND_ERROR "Auto mode not implemented for CURL_CA_PATH")
+elseif("${CURL_CA_PATH}" STREQUAL "")
+ message(SEND_ERROR "Invalid value of CURL_CA_PATH. Use 'none', 'auto' or path.")
+endif()
+
+
# Check for header files
if(NOT UNIX)
check_include_file_concat("windows.h" HAVE_WINDOWS_H)