]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/pakfire/lib/functions.pl
pakfire: Adjust code to deal with new LWP::UserAgent.
[people/pmueller/ipfire-2.x.git] / 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);