mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Issue 1447: Pass proper Host header and SNI when SRV is used with curl.
* configure.ac: Check for inet_ntop. * m4/libcurl.m4: Provide a #define for the version of the curl library. * keyserver/gpgkeys_hkp.c (main, srv_replace): Call getaddrinfo() on each target. Once we find one that resolves to an address (whether IPv4 or IPv6), pass it into libcurl via CURLOPT_RESOLVE using the SRV name as the "host". Force the HTTP Host header to be the same.
This commit is contained in:
parent
cbe98b2cb1
commit
6b1f71055e
3 changed files with 114 additions and 30 deletions
|
@ -65,6 +65,10 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
|
|||
AC_PROG_AWK
|
||||
|
||||
_libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
|
||||
# More recent versions of curl-config have a direct --vernum
|
||||
# option, but we'd like this code to work with older versions as
|
||||
# well, so just convert --version.
|
||||
_libcurl_vernum_parse="eval $AWK '{printf \"0x%06X\",\$NF}'"
|
||||
|
||||
_libcurl_try_link=yes
|
||||
|
||||
|
@ -184,6 +188,10 @@ x=CURLOPT_VERBOSE;
|
|||
AC_SUBST(LIBCURL_CPPFLAGS)
|
||||
AC_SUBST(LIBCURL)
|
||||
|
||||
_libcurl_vernum=`echo $_libcurl_version | $_libcurl_vernum_parse`
|
||||
|
||||
AC_DEFINE_UNQUOTED(LIBCURL_VERNUM,$_libcurl_vernum,[The version of the libcurl library in packed hex form])
|
||||
|
||||
for _libcurl_feature in $_libcurl_features ; do
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
|
||||
eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
|
||||
|
@ -224,6 +232,7 @@ x=CURLOPT_VERBOSE;
|
|||
unset _libcurl_protocol
|
||||
unset _libcurl_protocols
|
||||
unset _libcurl_version
|
||||
unset _libcurl_vernum
|
||||
unset _libcurl_ldflags
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue