shims/shared/curl: pass both --cafile and --capath to override defaults
This commit is contained in:
parent
2734fdbec6
commit
7f54793c49
@ -13,6 +13,25 @@ fi
|
||||
|
||||
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
|
||||
|
||||
# SSL_CERT_FILE alone does not clear the CAPath setting.
|
||||
set_certs=0
|
||||
if [[ -n "${SSL_CERT_FILE}" ]]
|
||||
then
|
||||
set_certs=1
|
||||
for arg in "$@"
|
||||
do
|
||||
if [[ "${arg}" =~ --ca(cert|path) ]]
|
||||
then
|
||||
# User passed their own settings - don't use ours!
|
||||
set_certs=0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [[ ${set_certs} -eq 1 ]]
|
||||
then
|
||||
set -- "--cacert" "${SSL_CERT_FILE}" "--capath" "$(dirname "${SSL_CERT_FILE}")" "$@"
|
||||
fi
|
||||
|
||||
try_exec_non_system "${HOMEBREW_CURL:-curl}" "$@"
|
||||
safe_exec "/usr/bin/curl" "$@"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user