summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2024-01-07 11:10:51 +0000
committerNorbert Preining <preining@logic.at>2024-01-07 11:10:51 +0000
commit9c0832652cdf7ed43f9af0ea3849ea0c4477f6e4 (patch)
tree9fa25c60ae794957fa99813846a09156f1c06780 /Master/tlpkg
parentf8849e85a086aeb5fd6c0d0f7ee33dc423c6e9fa (diff)
Set HTTPS_CA_FILE for LWP to work on global cert-free systems
git-svn-id: svn://tug.org/texlive/trunk@69327 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLDownload.pm11
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm5
2 files changed, 13 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLDownload.pm b/Master/tlpkg/TeXLive/TLDownload.pm
index 75fd01fa18b..d90641c6b68 100644
--- a/Master/tlpkg/TeXLive/TLDownload.pm
+++ b/Master/tlpkg/TeXLive/TLDownload.pm
@@ -40,10 +40,11 @@ if ($@) {
sub new
{
my $class = shift;
+ my %params = @_;
my $self = {};
$self->{'initcount'} = 0;
bless $self, $class;
- $self->reinit();
+ $self->reinit(defined($params{'certificates'}) ? $params{'certificates'} : "");
return $self;
}
@@ -52,6 +53,7 @@ sub new
sub reinit {
my $self = shift;
+ my $certs = shift;
# Irritatingly, as of around version 6.52, when env_proxy is set, LWP
# started unconditionally complaining if the environment contains
@@ -68,6 +70,13 @@ sub reinit {
@env_proxy = ("env_proxy", 1);
}
#
+ # Set HTTPS_CA_FILE to the TL provided certificate bundle
+ # for systems that don't have a system-wide certificate bundle
+ # in particular MacOS.
+ if ((! exists $ENV{'HTTPS_CA_FILE'}) && $certs) {
+ $ENV{'HTTPS_CA_FILE'} = $certs
+ }
+ #
my $ua = LWP::UserAgent->new(
agent => "texlive/lwp",
# use LWP::ConnCache, and keep 1 connection open
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 69566bc33b2..4997be204d8 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -4229,6 +4229,7 @@ false.
=cut
sub setup_persistent_downloads {
+ my $certs = shift;
if ($TeXLive::TLDownload::net_lib_avail) {
ddebug("setup_persistent_downloads has net_lib_avail set\n");
if ($::tldownload_server) {
@@ -4236,10 +4237,10 @@ sub setup_persistent_downloads {
debug("stop retrying to initialize LWP after 10 failures\n");
return 0;
} else {
- $::tldownload_server->reinit();
+ $::tldownload_server->reinit(certificates => $certs);
}
} else {
- $::tldownload_server = TeXLive::TLDownload->new;
+ $::tldownload_server = TeXLive::TLDownload->new(certificates => $certs);
}
if (!defined($::tldownload_server)) {
ddebug("TLUtils:setup_persistent_downloads: failed to get ::tldownload_server\n");