mk-ca-bundle.pl: delay 'curl -V' execution until it is needed

Avoid an `Can't exec "curl"` message when curl is not actually needed.

Closes #14060
This commit is contained in:
Sertonix 2024-06-29 19:36:25 +00:00 committed by Daniel Stenberg
parent 5c873da92a
commit 4fab113d4e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -136,8 +136,6 @@ else {
$url = $opt_d; $url = $opt_d;
} }
my $curl = `curl -V`;
if ($opt_i) { if ($opt_i) {
print ("=" x 78 . "\n"); print ("=" x 78 . "\n");
print "Script Version : $version\n"; print "Script Version : $version\n";
@ -314,6 +312,7 @@ if(!$opt_n) {
# If we have an HTTPS URL then use curl # If we have an HTTPS URL then use curl
if($url =~ /^https:\/\//i) { if($url =~ /^https:\/\//i) {
my $curl = `curl -V`;
if($curl) { if($curl) {
if($curl =~ /^Protocols:.* https( |$)/m) { if($curl =~ /^Protocols:.* https( |$)/m) {
report "Get certdata with curl!"; report "Get certdata with curl!";