]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
pakfire: Adjust code to deal with new LWP::UserAgent.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 3 Feb 2022 11:16:13 +0000 (12:16 +0100)
committerPeter Müller <peter.mueller@ipfire.org>
Wed, 9 Feb 2022 20:08:50 +0000 (20:08 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
src/pakfire/lib/functions.pl

index 87ce735409e5e8a1ce43c9eb75b10cc9701a4a08..8d0923d650fc1b5c5d6bbdf50643357ed6c61fc6 100644 (file)
@@ -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);