Provide some fallback defaults for the CA bundle

This commit is contained in:
Eelco Dolstra 2014-12-09 13:13:05 +01:00
parent e5891f2ea8
commit 5510d21193

View file

@ -42,6 +42,8 @@ my $curlIdCount = 1;
my %requests; my %requests;
my %scheduled; my %scheduled;
my $caBundle = $ENV{"SSL_CERT_FILE"} // $ENV{"CURL_CA_BUNDLE"} // $ENV{"OPENSSL_X509_CERT_FILE"}; my $caBundle = $ENV{"SSL_CERT_FILE"} // $ENV{"CURL_CA_BUNDLE"} // $ENV{"OPENSSL_X509_CERT_FILE"};
$caBundle = "/etc/ssl/certs/ca-bundle.crt" if !$caBundle && -f "/etc/ssl/certs/ca-bundle.crt";
$caBundle = "/etc/ssl/certs/ca-certificates.crt" if !$caBundle && -f "/etc/ssl/certs/ca-certificates.crt";
my $userName = getpwuid($<) || $ENV{"USER"} or die "cannot figure out user name"; my $userName = getpwuid($<) || $ENV{"USER"} or die "cannot figure out user name";