From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: bug#28948: feh does encounter certificate errors with valid certificates Date: Mon, 30 Oct 2017 00:47:16 +0100 Message-ID: <87r2tl4iuz.fsf@fastmail.com> References: <20171022203339.qomgp4xm2rqh4zwe@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8xJG-0006ZY-5f for bug-guix@gnu.org; Sun, 29 Oct 2017 19:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8xJC-0000QJ-8v for bug-guix@gnu.org; Sun, 29 Oct 2017 19:48:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8xJB-0000Po-SC for bug-guix@gnu.org; Sun, 29 Oct 2017 19:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e8xJB-000411-KQ for bug-guix@gnu.org; Sun, 29 Oct 2017 19:48:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171022203339.qomgp4xm2rqh4zwe@abyayala> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: ng0 , 28948@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain ng0 writes: > feh https://i.imgur.com/263enxT.jpg > feh opens image > > Problem: > user@abyayala ~/src/guix/guix$ feh https://i.imgur.com/263enxT.jpg > feh WARNING: open url: server certificate verification failed. CAfile: none CRLfile: none > feh WARNING: https://i.imgur.com/263enxT.jpg - File does not exist > feh: No loadable images specified. > See 'man feh' for detailed usage information > > nss etc are in my profile, no problem with other curl based applications. The attached patch should fix the problem. Can you try it? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-feh-Respect-CURL_CA_BUNDLE.patch Content-Transfer-Encoding: quoted-printable From=20cadea693c636affd0d4cc5749eb88b5408aac07f Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 30 Oct 2017 00:18:03 +0100 Subject: [PATCH] gnu: feh: Respect $CURL_CA_BUNDLE. * gnu/packages/patches/feh-respect-CURL_CA_BUNDLE.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/image-viewers.scm (feh)[source]: Use it. [native-search-paths]: New field. =2D-- gnu/local.mk | 1 + gnu/packages/image-viewers.scm | 8 ++++++++ gnu/packages/patches/feh-respect-CURL_CA_BUNDLE.patch | 18 +++++++++++++++= +++ 3 files changed, 27 insertions(+) create mode 100644 gnu/packages/patches/feh-respect-CURL_CA_BUNDLE.patch diff --git a/gnu/local.mk b/gnu/local.mk index 90dc7aec1..7a74501aa 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -616,6 +616,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/fasthenry-spFactor.patch \ %D%/packages/patches/fcgi-2.4.0-gcc44-fixes.patch \ %D%/packages/patches/fcgi-2.4.0-poll.patch \ + %D%/packages/patches/feh-respect-CURL_CA_BUNDLE.patch \ %D%/packages/patches/file-CVE-2017-1000249.patch \ %D%/packages/patches/findutils-localstatedir.patch \ %D%/packages/patches/findutils-gnulib-multi-core.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index 9e93a97a9..98193063e 100644 =2D-- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -61,6 +61,7 @@ (method url-fetch) (uri (string-append home-page name "-" version ".tar.bz2")) + (patches (search-patches "feh-respect-CURL_CA_BUNDLE.patch")) (sha256 (base32 "0azgpr4al2pi4858z4xh4lfz84cvzxw3n426fn7rz6cdj34q212j")))) @@ -79,6 +80,13 @@ ("libxt" ,libxt) ("libx11" ,libx11) ("libxinerama" ,libxinerama))) + (native-search-paths + ;; Respect the same options as the `curl` command-line client. + (list (search-path-specification + (variable "CURL_CA_BUNDLE") + (file-type 'regular) + (separator #f) ;single entry + (files '("etc/ssl/certs/ca-certificates.crt"))))) (synopsis "Fast and light imlib2-based image viewer") (description "feh is an X11 image viewer aimed mostly at console users. diff --git a/gnu/packages/patches/feh-respect-CURL_CA_BUNDLE.patch b/gnu/pa= ckages/patches/feh-respect-CURL_CA_BUNDLE.patch new file mode 100644 index 000000000..cbe2fa16d =2D-- /dev/null +++ b/gnu/packages/patches/feh-respect-CURL_CA_BUNDLE.patch @@ -0,0 +1,18 @@ +Make feh respect CURL_CA_BUNDLE similar to the `curl` tool. + +diff --git a/src/imlib.c b/src/imlib.c +index dfb79aa..82a9865 100644 +--- a/src/imlib.c ++++ b/src/imlib.c +@@ -429,6 +429,10 @@ static char *feh_http_load_image(char *url) + if (opt.insecure_ssl) { + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); ++ } else { ++ // Allow the user to specify custom CA certificates. ++ curl_easy_setopt(curl, CURLOPT_CAINFO, ++ getenv("CURL_CA_BUNDLE")); + } +=20 + res =3D curl_easy_perform(curl); + =2D-=20 2.14.3 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAln2aIQACgkQoqBt8qM6 VPp+9ggAzeabk6OIgz8/96z1NviodLiMpYKeANxi8aVc3GLc7aFwvNTjGBXG5hTx msqDnDzZ/kqEqpKcdVWsZ3lud/Bmdbq7osQLN8B4T4982VpYRdASDsyYo56gSWc6 B9RVo5i/erz+t69W+PgfRhWIEjjWF6WKlFY5OX8r4o/YTr/IG9oSbfOwiszhsoI+ jDTRSDvQajq8AhTQFdRp7Tp4f0o04E3YWHi87vH2iSnJNEOrtBSXq4F9Nhiue/jD NxfBml+pjV9D0JeNxoZB/uE9y70s/xB/XSHXRmsUZloJrX5quyX7MAq5PHwu6t1q 0D4B037UxtQ2l/OsihskbfPnRJEm+A== =zolM -----END PGP SIGNATURE----- --==-=-=--