aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/download.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/download.pl')
-rwxr-xr-xscripts/download.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/download.pl b/scripts/download.pl
index beb3abdeee..99708c456f 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -24,6 +24,8 @@ my $scriptdir = dirname($0);
my @mirrors;
my $ok;
+my $check_certificate = $ENV{DOWNLOAD_CHECK_CERTIFICATE} eq "y";
+
$url_filename or $url_filename = $filename;
sub localmirrors {
@@ -82,8 +84,8 @@ sub download_cmd($) {
}
return $have_curl
- ? (qw(curl -f --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
- : (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url)
+ ? (qw(curl -f --connect-timeout 20 --retry 5 --location), $check_certificate ? '' : '--insecure', shellwords($ENV{CURL_OPTIONS} || ''), $url)
+ : (qw(wget --tries=5 --timeout=20 --output-document=-), $check_certificate ? '' : '--no-check-certificate', shellwords($ENV{WGET_OPTIONS} || ''), $url)
;
}