From patchwork Thu Feb 3 11:16:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5045 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4JqGMZ5n7Pz3wp0 for ; Thu, 3 Feb 2022 11:16:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JqGMK2N3Nz1gD; Thu, 3 Feb 2022 11:16:29 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JqGMK2bB6z30JB; Thu, 3 Feb 2022 11:16:29 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JqGMH6blSz2xyg for ; Thu, 3 Feb 2022 11:16:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4JqGMF2lzZz5Gg; Thu, 3 Feb 2022 11:16:25 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1643886985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lfBwICiA5+Uq2cs/3aTYW5Ud0CUpRBC8wZNxsvND6ao=; b=a3mkGc4RVPgybCg1Ynr9yRHAYQjoBHXzthjWjjoxbyVmkUJPG/7XsrFcL7aGKtvDBV2NVe P7TniR62s32x9aCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1643886985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lfBwICiA5+Uq2cs/3aTYW5Ud0CUpRBC8wZNxsvND6ao=; b=mHHLL/nGvXDwfqpwJABDbo3NU2QjSdwFX0ua7TfkWVCf3Y7bHuQOg+YqY3JCNCwNV/TIhu C4T55YahzoQCBLbGSyOEzJ6mvV+lJ8bE3KrBfgr7hPqZ1+GZf254AU9ea9SGT98ViFp0pa /dyOCodG+eAKbjF4cXjbBlarPqIJ6i/5fXVCu2QqD22l1Y30aQinJkB/XlaAOkdNCxdziN CVFJLzRJ6c0W8T6qKvzGShcb027VIuaiJfvFGtvUE2nN1wHkGj1XdJvNkq9vjaFegbhy4X XbplWRqjelnTpg/T9XyXO5c0cg/jRU3M/gHTH6/dYaPvKu78ztAdEWmkuqhL7g== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 8/8] pakfire: Adjust code to deal with new LWP::UserAgent. Date: Thu, 3 Feb 2022 12:16:13 +0100 Message-Id: <20220203111613.13632-8-stefan.schantl@ipfire.org> In-Reply-To: <20220203111613.13632-1-stefan.schantl@ipfire.org> References: <20220203111613.13632-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl Reviewed-by: Peter Müller Reviewed-by: Adolf Belka --- src/pakfire/lib/functions.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 2f34763d5..37b930080 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);