Skip to content

Commit cf77871

Browse files
committed
ca native test 1
1 parent a1d31a5 commit cf77871

File tree

2 files changed

+58
-8
lines changed

2 files changed

+58
-8
lines changed

curl.dev.patch

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index c0cc0c57b8..aae23b6acd 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -778,6 +778,8 @@ if(CURL_USE_OPENSSL)
6+
list(APPEND CURL_LIBS "stdc++")
7+
list(APPEND CMAKE_REQUIRED_LIBRARIES "stdc++")
8+
endif()
9+
+ elseif(WIN32 AND CMAKE_COMPILER_IS_GNUCC AND HAVE_LIBRESSL)
10+
+ list(APPEND CURL_LIBS "ws2_32") # Add a duplicate to make binutils ld resolve symbols
11+
endif()
12+
13+
if(HAVE_BORINGSSL)
14+
@@ -1506,6 +1508,8 @@ endif()
15+
#
16+
# CA handling
17+
#
18+
+option(CURL_CA_NATIVE_BY_DEFAULT "Use native CA store by default in the curl tool" OFF)
19+
+
20+
if(_curl_ca_bundle_supported)
21+
set(CURL_CA_BUNDLE "auto" CACHE
22+
STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
23+
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
24+
index 0838ddccfb..6be0b40ece 100644
25+
--- a/lib/curl_config.h.cmake
26+
+++ b/lib/curl_config.h.cmake
27+
@@ -34,6 +34,9 @@
28+
/* Default SSL backend */
29+
#cmakedefine CURL_DEFAULT_SSL_BACKEND "${CURL_DEFAULT_SSL_BACKEND}"
30+
31+
+/* Use native CA store by default in curl tool */
32+
+#cmakedefine CURL_CA_NATIVE_BY_DEFAULT 1
33+
+
34+
/* disables alt-svc */
35+
#cmakedefine CURL_DISABLE_ALTSVC 1
36+
37+
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
38+
index 975ef2a458..5d71f1bd08 100644
39+
--- a/src/tool_cfgable.c
40+
+++ b/src/tool_cfgable.c
41+
@@ -50,6 +50,12 @@ struct OperationConfig *config_alloc(struct GlobalConfig *global)
42+
config->file_clobber_mode = CLOBBER_DEFAULT;
43+
config->upload_flags = CURLULFLAG_SEEN;
44+
curlx_dyn_init(&config->postdata, MAX_FILE2MEMORY);
45+
+
46+
+#ifdef CURL_CA_NATIVE_BY_DEFAULT
47+
+ config->native_ca_store = TRUE;
48+
+ config->proxy_native_ca_store = TRUE;
49+
+#endif
50+
+
51+
return config;
52+
}
53+

curl.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,11 @@ _VER="$1"
344344
if [ -n "${_OPENSSL}" ]; then
345345
if [ "${_OS}" = 'mac' ] && [ "${CURL_VER_}" != '8.16.0' ]; then
346346
options+=' -DUSE_APPLE_SECTRUST=ON'
347-
else
348-
if [[ "${_DEPS}" = *'cacert'* ]]; then
349-
options+=" -DCURL_CA_EMBED=${_TOP}/cacert/${_CACERT}"
350-
fi
351-
352-
if [ "${_OS}" = 'win' ]; then
353-
options+=' -DCURL_CA_SEARCH_SAFE=ON'
354-
fi
347+
elif [ "${_OS}" = 'win' ]; then
348+
options+=' -DCURL_CA_NATIVE_BY_DEFAULT=ON'
349+
options+=' -DCURL_DISABLE_CA_SEARCH=ON'
350+
elif [[ "${_DEPS}" = *'cacert'* ]]; then
351+
options+=" -DCURL_CA_EMBED=${_TOP}/cacert/${_CACERT}"
355352
fi
356353
fi
357354
else

0 commit comments

Comments
 (0)