Skip to content

Commit 9497363

Browse files
committed
ca native test 1
1 parent 4cc3194 commit 9497363

File tree

2 files changed

+69
-8
lines changed

2 files changed

+69
-8
lines changed

curl.dev.patch

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
54+
diff --git a/wcurl b/wcurl
55+
index 7b53b74..45857d6 100755
56+
--- a/scripts/wcurl
57+
+++ b/scripts/wcurl
58+
@@ -85,7 +85,7 @@ _EOF_
59+
# Display an error message and bail out.
60+
error()
61+
{
62+
- printf "%s\n" "$*" > /dev/stderr
63+
+ printf "%s\n" "$*" >&2
64+
exit 1

curl.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,11 @@ _VER="$1"
349349
if [ -n "${_OPENSSL}" ]; then
350350
if [ "${_OS}" = 'mac' ]; then
351351
options+=' -DUSE_APPLE_SECTRUST=ON'
352-
else
353-
if [[ "${_DEPS}" = *'cacert'* ]]; then
354-
options+=" -DCURL_CA_EMBED=${_TOP}/cacert/${_CACERT}"
355-
fi
356-
357-
if [ "${_OS}" = 'win' ]; then
358-
options+=' -DCURL_CA_SEARCH_SAFE=ON'
359-
fi
352+
elif [ "${_OS}" = 'win' ]; then
353+
options+=' -DCURL_CA_NATIVE_BY_DEFAULT=ON'
354+
options+=' -DCURL_DISABLE_CA_SEARCH=ON'
355+
elif [[ "${_DEPS}" = *'cacert'* ]]; then
356+
options+=" -DCURL_CA_EMBED=${_TOP}/cacert/${_CACERT}"
360357
fi
361358
fi
362359
else

0 commit comments

Comments
 (0)