Artifactspublic-v0

curl

master
ply4 git calls49 ms290 KiB3 cachedprotocol v2
372 lines11 KiBRaw
1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
21# SPDX-License-Identifier: curl
23#***************************************************************************
25dnl File version for 'aclocal' use. Keep it a single number.
26dnl serial 5
28dnl **********************************************************************
29dnl Check for OpenSSL libraries and headers
30dnl **********************************************************************
32AC_DEFUN([CURL_WITH_OPENSSL], [
33if test "x$OPT_OPENSSL" != "xno"; then
34 ssl_msg=
36 dnl backup the pre-detection variables
37 CLEANLDFLAGS="$LDFLAGS"
38 CLEANLDFLAGSPC="$LDFLAGSPC"
39 CLEANCPPFLAGS="$CPPFLAGS"
40 CLEANLIBS="$LIBS"
42 dnl This is for MSYS/MinGW
43 case $host in
44 *-*-msys* | *-*-mingw*)
45 AC_MSG_CHECKING([for gdi32])
46 my_ac_save_LIBS=$LIBS
47 LIBS="-lgdi32 $LIBS"
48 AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
49 #ifndef WIN32_LEAN_AND_MEAN
50 #define WIN32_LEAN_AND_MEAN
51 #endif
52 #include <windef.h>
53 #include <wingdi.h>
54 ]],
55 [[
56 GdiFlush();
57 ]])],
58 [ dnl worked!
59 AC_MSG_RESULT([yes])],
60 [ dnl failed, restore LIBS
61 LIBS=$my_ac_save_LIBS
62 AC_MSG_RESULT(no)]
63 )
64 ;;
65 esac
67 case "$OPT_OPENSSL" in
68 yes)
69 dnl --with-openssl (without path) used
70 PKGTEST="yes"
71 PREFIX_OPENSSL=
72 ;;
73 *)
74 dnl check the given --with-openssl spot
75 PKGTEST="no"
76 PREFIX_OPENSSL=$OPT_OPENSSL
78 dnl Try pkg-config even when cross-compiling. Since we
79 dnl specify PKG_CONFIG_LIBDIR we are only looking where
80 dnl the user told us to look
81 OPENSSL_PCDIR="$OPT_OPENSSL/lib/pkgconfig"
82 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
83 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR is set to "$OPENSSL_PCDIR"])
84 PKGTEST="yes"
85 fi
87 if test "$PKGTEST" != "yes"; then
88 dnl try lib64 instead
89 OPENSSL_PCDIR="$OPT_OPENSSL/lib64/pkgconfig"
90 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
91 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR is set to "$OPENSSL_PCDIR"])
92 PKGTEST="yes"
93 fi
94 fi
96 if test "$PKGTEST" != "yes" &&
97 test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
98 AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-openssl prefix!])
99 fi
101 dnl in case pkg-config comes up empty, use what we got
102 dnl via --with-openssl
103 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
104 if test "$PREFIX_OPENSSL" != "/usr"; then
105 SSL_LDFLAGS="-L$LIB_OPENSSL"
106 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
107 fi
108 ;;
109 esac
111 if test "$PKGTEST" = "yes"; then
113 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
115 if test "$PKGCONFIG" != "no"; then
116 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR])
117 $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null`
119 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR])
120 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
122 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR])
123 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
125 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
126 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
127 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
129 LIB_OPENSSL=`echo $SSL_LDFLAGS | $SED -e 's/^-L//'`
131 dnl use the values pkg-config reported. This is here
132 dnl instead of below with CPPFLAGS and LDFLAGS because we only
133 dnl learn about this via pkg-config. If we only have
134 dnl the argument to --with-openssl we do not know what
135 dnl additional libs may be necessary. Hope that we
136 dnl do not need any.
137 LIBS="$SSL_LIBS $LIBS"
138 fi
139 fi
141 dnl finally, set flags to use SSL
142 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
143 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
144 LDFLAGSPC="$LDFLAGSPC $SSL_LDFLAGS"
146 AC_CHECK_LIB(crypto, HMAC_Update,[
147 HAVECRYPTO="yes"
148 LIBS="-lcrypto $LIBS"
149 ],[
150 if test -n "$LIB_OPENSSL"; then
151 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
152 LDFLAGSPC="$CLEANLDFLAGSPC -L$LIB_OPENSSL"
153 fi
154 if test "$PKGCONFIG" = "no" && test -n "$PREFIX_OPENSSL"; then
155 dnl only set this if pkg-config was not used
156 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include"
157 fi
158 dnl Linking previously failed, try extra paths from --with-openssl or
159 dnl pkg-config. Use a different function name to avoid reusing the earlier
160 dnl cached result.
161 AC_CHECK_LIB(crypto, HMAC_Init_ex,[
162 HAVECRYPTO="yes"
163 LIBS="-lcrypto $LIBS"], [
165 dnl still no, but what about with -ldl?
166 AC_MSG_CHECKING([OpenSSL linking with -ldl])
167 LIBS="-lcrypto $CLEANLIBS -ldl"
168 AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
169 #include <openssl/err.h>
170 ]], [[
171 ERR_clear_error();
172 ]]) ],
173 [
174 AC_MSG_RESULT(yes)
175 HAVECRYPTO="yes"
176 ],
177 [
178 AC_MSG_RESULT(no)
179 dnl ok, so what about both -ldl and -lpthread?
180 dnl This may be necessary for static libraries.
182 AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
183 LIBS="-lcrypto $CLEANLIBS -ldl -lpthread"
184 AC_LINK_IFELSE([
185 AC_LANG_PROGRAM([[
186 #include <openssl/err.h>
187 ]], [[
188 ERR_clear_error();
189 ]])],
190 [
191 AC_MSG_RESULT(yes)
192 HAVECRYPTO="yes"
193 ],
194 [
195 AC_MSG_RESULT(no)
196 LDFLAGS="$CLEANLDFLAGS"
197 LDFLAGSPC="$CLEANLDFLAGSPC"
198 CPPFLAGS="$CLEANCPPFLAGS"
199 LIBS="$CLEANLIBS"
200 ])
201 ])
202 ])
203 ])
205 if test "$HAVECRYPTO" = "yes"; then
206 dnl This is only reasonable to do if crypto actually is there: check for
207 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
209 AC_CHECK_LIB(ssl, SSL_connect)
211 if test "$ac_cv_lib_ssl_SSL_connect" = "yes"; then
212 dnl Have the libraries--check for OpenSSL headers
213 AC_CHECK_HEADERS(openssl/rsa.h openssl/crypto.h openssl/pem.h openssl/ssl.h openssl/err.h,
214 ssl_msg="OpenSSL"
215 test "openssl" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
216 OPENSSL_ENABLED=1
217 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
218 fi
220 if test "$OPENSSL_ENABLED" != "1"; then
221 LIBS="$CLEANLIBS"
222 AC_MSG_ERROR([OpenSSL libs and/or directories were not found!])
223 fi
224 fi
226 if test "$OPENSSL_ENABLED" = "1"; then
227 dnl These can only exist if OpenSSL exists
229 AC_MSG_CHECKING([for AWS-LC])
230 AC_COMPILE_IFELSE([
231 AC_LANG_PROGRAM([[
232 #include <openssl/base.h>
233 ]],[[
234 #ifndef OPENSSL_IS_AWSLC
235 #error not AWS-LC
236 #endif
237 ]])
238 ],[
239 AC_MSG_RESULT([yes])
240 ssl_msg="AWS-LC"
241 OPENSSL_IS_AWSLC=1
242 ],[
243 AC_MSG_RESULT([no])
244 ])
246 AC_MSG_CHECKING([for BoringSSL])
247 AC_COMPILE_IFELSE([
248 AC_LANG_PROGRAM([[
249 #include <openssl/base.h>
250 ]],[[
251 #ifndef OPENSSL_IS_BORINGSSL
252 #error not BoringSSL
253 #endif
254 ]])
255 ],[
256 AC_MSG_RESULT([yes])
257 ssl_msg="BoringSSL"
258 OPENSSL_IS_BORINGSSL=1
259 ],[
260 AC_MSG_RESULT([no])
261 ])
263 AC_MSG_CHECKING([for LibreSSL])
264 AC_COMPILE_IFELSE([
265 AC_LANG_PROGRAM([[
266 #include <openssl/opensslv.h>
267 ]],[[
268 #ifndef LIBRESSL_VERSION_NUMBER
269 #error not LibreSSL
270 #endif
271 ]])
272 ],[
273 AC_MSG_RESULT([yes])
274 ssl_msg="LibreSSL"
275 HAVE_LIBRESSL=1
276 ],[
277 AC_MSG_RESULT([no])
278 ])
280 if test "$ssl_msg" = 'OpenSSL'; then
281 AC_MSG_CHECKING([for OpenSSL >= 3])
282 AC_COMPILE_IFELSE([
283 AC_LANG_PROGRAM([[
284 #include <openssl/opensslv.h>
285 ]],[[
286 #if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
287 return 0;
288 #else
289 #error older than 3
290 #endif
291 ]])
292 ],[],[
293 AC_MSG_ERROR([OpenSSL 3.0.0 or greater required])
294 ])
295 fi
296 fi
298 dnl is this OpenSSL (fork) providing the original QUIC API?
299 AC_CHECK_FUNCS([SSL_set_quic_use_legacy_codepoint], [QUIC_ENABLED=yes])
300 if test "$QUIC_ENABLED" = "yes"; then
301 AC_MSG_NOTICE([OpenSSL fork speaks QUIC API])
302 else
303 AC_CHECK_FUNCS([SSL_set_quic_tls_cbs], [QUIC_ENABLED=yes])
304 if test "$QUIC_ENABLED" = "yes"; then
305 AC_MSG_NOTICE([OpenSSL with QUIC APIv2])
306 OPENSSL_QUIC_API2=1
307 else
308 AC_MSG_NOTICE([OpenSSL version does not speak any known QUIC API])
309 fi
310 fi
312 if test "$OPENSSL_ENABLED" = "1"; then
313 if test -n "$LIB_OPENSSL"; then
314 dnl when the SSL shared libs were found in a path that the runtime
315 dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH
316 dnl to prevent further configure tests to fail due to this
317 if test "$cross_compiling" != "yes"; then
318 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
319 export CURL_LIBRARY_PATH
320 AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
321 fi
322 fi
323 check_for_ca_bundle=1
324 if test "$OPENSSL_IS_BORINGSSL" != "1"; then dnl BoringSSL does not provide openssl.pc
325 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE openssl"
326 fi
327 fi
329 if test "$OPENSSL_ENABLED" != "1"; then
330 AC_MSG_NOTICE([OPT_OPENSSL: $OPT_OPENSSL])
331 AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED])
332 AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected])
333 fi
335 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
336fi dnl OpenSSL not disabled
338if test "$OPENSSL_ENABLED" = "1"; then
339 dnl ---
340 dnl We check OpenSSL for DES support.
341 dnl ---
342 AC_MSG_CHECKING([for DES support in OpenSSL])
343 AC_LINK_IFELSE([
344 AC_LANG_PROGRAM([[
345 #ifndef OPENSSL_SUPPRESS_DEPRECATED
346 #define OPENSSL_SUPPRESS_DEPRECATED
347 #endif
348 #include <openssl/des.h>
349 ]],[[
350 DES_ecb_encrypt(0, 0, 0, DES_ENCRYPT);
351 ]])
352 ],[
353 AC_MSG_RESULT([yes])
354 AC_DEFINE(HAVE_DES_ECB_ENCRYPT, 1, [if you have the function DES_ecb_encrypt])
355 HAVE_DES_ECB_ENCRYPT=1
356 ],[
357 AC_MSG_RESULT([no])
358 ])
360 dnl ---
361 dnl Whether the OpenSSL configuration is loaded automatically
362 dnl ---
363 AC_ARG_ENABLE(openssl-auto-load-config,
364AS_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration])
365AS_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]),
366 [ if test "x$enableval" = "xno"; then
367 AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled])
368 AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration is not loaded automatically])
369 fi
370 ])
371fi
372])
Diagnostics4 git calls · 49 ms
CallStatusSizeTime049 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=44
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2003.5 KiB · hit44 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=3618
git.response.cache=HIT
git.response.duration_ms=44
git.fetch.wants=eacac1267e9c090f66ab8e64a3a59693d1d6aa8a
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=3618
git.pkt.payload.max=3597
git.sideband.band1.bytes=3596
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e32a3129015094
Request
66273530…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format