~现在跳过证书验证开关对内置下载工具也有效

This commit is contained in:
juewuy
2026-02-02 19:30:43 +08:00
parent 1bd16b5ca6
commit 0ca7bb8eb2

View File

@@ -17,14 +17,22 @@ webget(){
if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress' [ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect='' [ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
[ "$5" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate' if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
certificate=''
else
certificate='--no-check-certificate'
fi
wget -Y on $agent $progress $redirect $certificate --timeout=3 -O "$1" "$url" && return 0 #成功则退出否则重试 wget -Y on $agent $progress $redirect $certificate --timeout=3 -O "$1" "$url" && return 0 #成功则退出否则重试
wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2" wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2"
return $? return $?
elif curl --version >/dev/null 2>&1; then elif curl --version >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-s' || progress='-#' [ "$3" = "echooff" ] && progress='-s' || progress='-#'
[ "$4" = "rediroff" ] && redirect='' || redirect='-L' [ "$4" = "rediroff" ] && redirect='' || redirect='-L'
[ "$5" = "skipceroff" ] && certificate='' || certificate='-k' if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
certificate=''
else
certificate='-k'
fi
if curl --version | grep -q '^curl 8.' && ckcmd base64; then if curl --version | grep -q '^curl 8.' && ckcmd base64; then
auth_b64=$(printf '%s' "$authentication" | base64) auth_b64=$(printf '%s' "$authentication" | base64)
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 --proxy-header "Proxy-Authorization: Basic $auth_b64" $progress $redirect $certificate -o "$1" "$url") result=$(curl $agent -w '%{http_code}' --connect-timeout 3 --proxy-header "Proxy-Authorization: Basic $auth_b64" $progress $redirect $certificate -o "$1" "$url")