master
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.
13#
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.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23#***************************************************************************
25AC_DEFUN([CURL_WITH_RUSTLS], [
26dnl ----------------------------------------------------
27dnl check for Rustls
28dnl ----------------------------------------------------
30if test "x$OPT_RUSTLS" != "xno"; then
31 ssl_msg=
33 dnl backup the pre-detection variables
34 CLEANLDFLAGS="$LDFLAGS"
35 CLEANLDFLAGSPC="$LDFLAGSPC"
36 CLEANCPPFLAGS="$CPPFLAGS"
38 dnl NEW CODE
40 dnl use pkg-config unless we have been given a path
41 dnl even then, try pkg-config first
43 case "$OPT_RUSTLS" in
44 yes)
45 dnl --with-rustls (without path) used
46 PKGTEST="yes"
47 PREFIX_RUSTLS=
48 ;;
49 *)
50 dnl check the provided --with-rustls path
51 PKGTEST="no"
52 PREFIX_RUSTLS=$OPT_RUSTLS
54 dnl Try pkg-config even when cross-compiling. Since we
55 dnl specify PKG_CONFIG_LIBDIR we are only looking where
56 dnl the user told us to look
58 RUSTLS_PCDIR="$PREFIX_RUSTLS/lib/pkgconfig"
59 if test -f "$RUSTLS_PCDIR/rustls.pc"; then
60 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR is set to "$RUSTLS_PCDIR"])
61 PKGTEST="yes"
62 fi
64 if test "$PKGTEST" != "yes"; then
65 dnl try lib64 instead
66 RUSTLS_PCDIR="$PREFIX_RUSTLS/lib64/pkgconfig"
67 if test -f "$RUSTLS_PCDIR/rustls.pc"; then
68 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR is set to "$RUSTLS_PCDIR"])
69 PKGTEST="yes"
70 fi
71 fi
73 if test "$PKGTEST" != "yes"; then
74 dnl pkg-config came up empty, use what we got
75 dnl via --with-rustls
77 addld=-L$PREFIX_RUSTLS/lib$libsuff
78 addcflags=-I$PREFIX_RUSTLS/include
80 LDFLAGS="$LDFLAGS $addld"
81 LDFLAGSPC="$LDFLAGSPC $addld"
82 if test "$addcflags" != "-I/usr/include"; then
83 CPPFLAGS="$CPPFLAGS $addcflags"
84 fi
86 if test "$curl_cv_apple" = "yes"; then
87 RUSTLS_LDFLAGS="-framework Security -framework Foundation"
88 else
89 RUSTLS_LDFLAGS="-lpthread -ldl -lm"
90 fi
92 LIB_RUSTLS="$PREFIX_RUSTLS/lib$libsuff"
93 if test "$PREFIX_RUSTLS" != "/usr"; then
94 SSL_LDFLAGS="-L$LIB_RUSTLS $RUSTLS_LDFLAGS"
95 SSL_CPPFLAGS="-I$PREFIX_RUSTLS/include"
96 fi
98 dnl we verify AC_CHECK_LIB later on
99 AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled])
100 USE_RUSTLS="yes"
101 fi
102 ;;
103 esac
105 link_pkgconfig=''
107 if test "$PKGTEST" = "yes"; then
109 CURL_CHECK_PKGCONFIG(rustls, [$RUSTLS_PCDIR])
111 if test "$PKGCONFIG" != "no"; then
112 SSL_LIBS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR])
113 $PKGCONFIG --libs-only-l --libs-only-other rustls 2>/dev/null`
115 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR])
116 $PKGCONFIG --libs-only-L rustls 2>/dev/null`
118 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR])
119 $PKGCONFIG --cflags-only-I rustls 2>/dev/null`
121 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
122 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
123 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
125 LIB_RUSTLS=`echo $SSL_LDFLAGS | $SED -e 's/^-L//'`
127 dnl use the values pkg-config reported. This is here
128 dnl instead of below with CPPFLAGS and LDFLAGS because we only
129 dnl learn about this via pkg-config. If we only have
130 dnl the argument to --with-rustls we do not know what
131 dnl additional libs may be necessary. Hope that we
132 dnl do not need any.
133 LIBS="$SSL_LIBS $LIBS"
134 link_pkgconfig=1
135 ssl_msg="Rustls"
136 AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled])
137 USE_RUSTLS="yes"
138 RUSTLS_ENABLED=1
139 test "rustls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
140 else
141 AC_MSG_ERROR([pkg-config: Could not find Rustls])
142 fi
144 else
145 dnl we did not use pkg-config, so we need to add the
146 dnl Rustls lib to LIBS
147 LIBS="-lrustls -lpthread -ldl -lm $LIBS"
148 fi
150 dnl finally, set flags to use this TLS backend
151 CPPFLAGS="$CLEANCPPFLAGS $SSL_CPPFLAGS"
152 LDFLAGS="$CLEANLDFLAGS $SSL_LDFLAGS"
153 LDFLAGSPC="$CLEANLDFLAGSPC $SSL_LDFLAGS"
155 if test "$USE_RUSTLS" = "yes"; then
156 AC_MSG_NOTICE([detected Rustls])
157 check_for_ca_bundle=1
159 if test -n "$LIB_RUSTLS"; then
160 dnl when shared libs were found in a path that the runtime
161 dnl linker does not search through, we need to add it to
162 dnl CURL_LIBRARY_PATH so that further configure tests do not
163 dnl fail due to this
164 if test "$cross_compiling" != "yes"; then
165 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_RUSTLS"
166 export CURL_LIBRARY_PATH
167 AC_MSG_NOTICE([Added $LIB_RUSTLS to CURL_LIBRARY_PATH])
168 fi
169 fi
170 if test -n "$link_pkgconfig"; then
171 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE rustls"
172 fi
174 AC_CHECK_LIB(rustls, rustls_supported_hpke,
175 [
176 AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled])
177 RUSTLS_ENABLED=1
178 USE_RUSTLS="yes"
179 ssl_msg="Rustls"
180 test "rustls" != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
181 ],
182 AC_MSG_ERROR([--with-rustls was specified but could not find compatible Rustls.]),
183 $RUSTLS_LDFLAGS)
184 fi
186 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
188 if test "$RUSTLS_ENABLED" != "1"; then
189 AC_MSG_NOTICE([OPT_RUSTLS: $OPT_RUSTLS])
190 AC_MSG_NOTICE([RUSTLS_ENABLED: $RUSTLS_ENABLED])
191 AC_MSG_ERROR([--with-rustls was given but Rustls could not be detected])
192 fi
193fi
194])
Diagnostics4 git calls · 158 ms
CallStatusSizeTime0158 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=153 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=86Open pack map
fetch2002.3 KiB153 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=2338 git.response.cache=MISS git.response.duration_ms=153 git.fetch.wants=064e2bc813fc051f1fdd6ec42b85df22eaece096 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=2338 git.pkt.payload.max=2317 git.sideband.band1.bytes=2316 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
- a5e318fd48443e6e
- Request
- 7fdcb7f7…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format