From: Stefan Schantl Date: Thu, 3 Feb 2022 11:16:13 +0000 (+0100) Subject: pakfire: Adjust code to deal with new LWP::UserAgent. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53f7dc7620bfb51e8b1daa8c727206425e06d87a;p=people%2Fms%2Fipfire-2.x.git pakfire: Adjust code to deal with new LWP::UserAgent. Signed-off-by: Stefan Schantl Reviewed-by: Peter Müller --- diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 87ce735409..8d0923d650 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -155,7 +155,14 @@ sub fetchfile { logger("DOWNLOAD INFO: Host: $host ($proto) - File: $file"); - my $ua = LWP::UserAgent->new; + # Init LWP::UserAgent, request SSL hostname verification + # and specify CA file. + my $ua = LWP::UserAgent->new( + ssl_opts => { + SSL_ca_file => '/etc/ssl/cert.pem', + verify_hostname => 1, + } + ); $ua->agent("Pakfire/$Conf::version"); $ua->timeout(20);