Skip to content

Commit 9601068

Browse files
author
Chad Dougherty
committed
handle the case of using the busybox version of wget
Signed-off-by: Chad Dougherty <crd@acm.org>
1 parent 59de864 commit 9601068

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

rustup-init.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,20 +508,26 @@ downloader() {
508508
fi
509509
return $_status
510510
elif [ "$_dld" = wget ]; then
511-
get_ciphersuites_for_wget
512-
_ciphersuites="$RETVAL"
513-
if [ -n "$_ciphersuites" ]; then
514-
_err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
511+
if [ "$(wget -V 2>&1|head -2|tail -1|cut -f1 -d" ")" = "BusyBox" ]; then
512+
echo "Warning: using the BusyBox version of wget. Not enforcing strong cipher suites for TLS or TLS v1.2, this is potentially less secure"
513+
_err=$(wget "$1" -O "$2" 2>&1)
515514
_status=$?
516515
else
517-
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
518-
if ! check_help_for "$3" wget --https-only --secure-protocol; then
519-
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
520-
_err=$(wget "$1" -O "$2" 2>&1)
516+
get_ciphersuites_for_wget
517+
_ciphersuites="$RETVAL"
518+
if [ -n "$_ciphersuites" ]; then
519+
_err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
521520
_status=$?
522521
else
523-
_err=$(wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" 2>&1)
524-
_status=$?
522+
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
523+
if ! check_help_for "$3" wget --https-only --secure-protocol; then
524+
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
525+
_err=$(wget "$1" -O "$2" 2>&1)
526+
_status=$?
527+
else
528+
_err=$(wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" 2>&1)
529+
_status=$?
530+
fi
525531
fi
526532
fi
527533
if [ -n "$_err" ]; then

0 commit comments

Comments
 (0)