summaryrefslogtreecommitdiff
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
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
-rwxr-xr-xMaster/install-tl4
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl4
-rw-r--r--Master/tlpkg/TeXLive/TLDownload.pm11
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm5
4 files changed, 19 insertions, 5 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 4b43170b0c3..1c53a8304c5 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -914,7 +914,9 @@ sub final_remote_init {
} elsif ($media eq "NET") {
info("Distribution: net (downloading)\n");
info("Using URL: $TeXLiveURL\n");
- TeXLive::TLUtils::setup_persistent_downloads() if $opt_persistent_downloads;
+ TeXLive::TLUtils::setup_persistent_downloads(
+ "$::installerdir/tlpkg/installer/curl/curl-ca-bundle.crt"
+ ) if $opt_persistent_downloads;
} else {
info("Distribution: $media\n");
}
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 2dc8a5823e0..86c821ce9ce 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -690,7 +690,9 @@ for the full story.\n";
# if we are asked to use persistent connections try to start it here
ddebug("tlmgr:main: do persistent downloads = $opts{'persistent-downloads'}\n");
if ($opts{'persistent-downloads'}) {
- TeXLive::TLUtils::setup_persistent_downloads() ;
+ TeXLive::TLUtils::setup_persistent_downloads(
+ "$Master/tlpkg/installer/curl/curl-ca-bundle.crt"
+ ) ;
}
if (!defined($::tldownload_server)) {
debug("tlmgr:main: ::tldownload_server not defined\n");
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");