acinclude: fix --without-ca-path when cross-compiling

The commit 7b074a460b to CURL_CHECK_CA_BUNDLE in 7.31 (don't check
for paths when cross-compiling) causes --without-ca-path to no longer
works when cross-compiling, since ca and capath only ever get set to
"no" when not cross-compiling, I attach a patch that works for me. Also
in the cross-compilation case, no ca-path seems to be a better default
(IMVHO) than empty ca-path.

Bug: http://curl.haxx.se/bug/view.cgi?id=1273
Patch-by: Stefan Neis
This commit is contained in:
Daniel Stenberg 2013-09-04 00:01:03 +02:00
parent f73f052010
commit 073b03fab7

View File

@ -2619,48 +2619,49 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
fi fi
capath="$want_capath" capath="$want_capath"
ca="no" ca="no"
elif test "x$cross_compiling" != "xyes"; then else
dnl NOT cross-compiling and...
dnl neither of the --with-ca-* options are provided
dnl first try autodetecting a CA bundle , then a CA path dnl first try autodetecting a CA bundle , then a CA path
dnl both autodetections can be skipped by --without-ca-* dnl both autodetections can be skipped by --without-ca-*
ca="no" ca="no"
capath="no" capath="no"
if test "x$want_ca" = "xunset"; then if test "x$cross_compiling" != "xyes"; then
dnl the path we previously would have installed the curl ca bundle dnl NOT cross-compiling and...
dnl to, and thus we now check for an already existing cert in that place dnl neither of the --with-ca-* options are provided
dnl in case we find no other if test "x$want_ca" = "xunset"; then
if test "x$prefix" != xNONE; then dnl the path we previously would have installed the curl ca bundle
cac="${prefix}/share/curl/curl-ca-bundle.crt" dnl to, and thus we now check for an already existing cert in that
else dnl place in case we find no other
cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" if test "x$prefix" != xNONE; then
fi cac="${prefix}/share/curl/curl-ca-bundle.crt"
else
cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
fi
for a in /etc/ssl/certs/ca-certificates.crt \ for a in /etc/ssl/certs/ca-certificates.crt \
/etc/pki/tls/certs/ca-bundle.crt \ /etc/pki/tls/certs/ca-bundle.crt \
/usr/share/ssl/certs/ca-bundle.crt \ /usr/share/ssl/certs/ca-bundle.crt \
/usr/local/share/certs/ca-root.crt \ /usr/local/share/certs/ca-root.crt \
/etc/ssl/cert.pem \ /etc/ssl/cert.pem \
"$cac"; do "$cac"; do
if test -f "$a"; then if test -f "$a"; then
ca="$a" ca="$a"
break break
fi fi
done done
fi
if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
"x$OPENSSL_ENABLED" = "x1"; then
for a in /etc/ssl/certs/; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
capath="$a"
break
fi
done
fi
else
dnl no option given and cross-compiling
AC_MSG_WARN([skipped the ca-cert path detection when cross-compiling])
fi fi
if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
"x$OPENSSL_ENABLED" = "x1"; then
for a in /etc/ssl/certs/; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
capath="$a"
break
fi
done
fi
else
dnl no option given and cross-compiling
AC_MSG_WARN([skipped the ca-cert path detection when cross-compiling])
fi fi
if test "x$ca" != "xno"; then if test "x$ca" != "xno"; then