Skip to content

Commit 18b912a

Browse files
authored
Merge pull request #2885 from crd477/busybox-wget
better handle the case of using busybox wget
2 parents 43c4999 + 9601068 commit 18b912a

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
@@ -511,20 +511,26 @@ downloader() {
511511
fi
512512
return $_status
513513
elif [ "$_dld" = wget ]; then
514-
get_ciphersuites_for_wget
515-
_ciphersuites="$RETVAL"
516-
if [ -n "$_ciphersuites" ]; then
517-
_err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
514+
if [ "$(wget -V 2>&1|head -2|tail -1|cut -f1 -d" ")" = "BusyBox" ]; then
515+
echo "Warning: using the BusyBox version of wget. Not enforcing strong cipher suites for TLS or TLS v1.2, this is potentially less secure"
516+
_err=$(wget "$1" -O "$2" 2>&1)
518517
_status=$?
519518
else
520-
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
521-
if ! check_help_for "$3" wget --https-only --secure-protocol; then
522-
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
523-
_err=$(wget "$1" -O "$2" 2>&1)
519+
get_ciphersuites_for_wget
520+
_ciphersuites="$RETVAL"
521+
if [ -n "$_ciphersuites" ]; then
522+
_err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
524523
_status=$?
525524
else
526-
_err=$(wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" 2>&1)
527-
_status=$?
525+
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
526+
if ! check_help_for "$3" wget --https-only --secure-protocol; then
527+
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
528+
_err=$(wget "$1" -O "$2" 2>&1)
529+
_status=$?
530+
else
531+
_err=$(wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" 2>&1)
532+
_status=$?
533+
fi
528534
fi
529535
fi
530536
if [ -n "$_err" ]; then

0 commit comments

Comments
 (0)