summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-02-10 21:54:34 +0900
committerAndreas Enge <andreas@enge.fr>2026-03-06 14:52:03 +0100
commit38e7132dcfd37799a1392eb1a6fcdaa2c16bdfef (patch)
treebb4393c7a551b758ffdfc1d3867d56781d6d4f9b
parent356234dc5f4f70aace50542f50bcda07378f8716 (diff)
gnu: gnutls: Use p11-kit to provide the default certificates.
This makes it so that GnuTLS always knows to locate the nss-certs without users having to do anything. This default behavior can be modified by users via the p11-kit configuration mechanism, which can be be done per-user. * gnu/packages/patches/gnutls-skip-trust-store-test.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. * gnu/packages/tls.scm (gnutls) [source]: Remove 'gnutls-skip-trust-store-test.patch' patch. [#:configure-flags]: Delete "--with-default-trust-store-dir=/etc/ssl/certs". Add "--with-default-trust-store-pkcs11=pkcs11:". Update comment. Fixes: <https://issues.guix.gnu.org/75902> Fixes: <https://issues.guix.gnu.org/46779> Change-Id: Ie45bfe8c2884c1ab277b0fba6135a5af3a9b6a3d
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/gnutls-skip-trust-store-test.patch15
-rw-r--r--gnu/packages/tls.scm18
3 files changed, 6 insertions, 28 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 1b4d3ac37b6..f3c01e0e9c5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1518,7 +1518,6 @@ dist_patch_DATA = \
1518 %D%/packages/patches/gnumach-version.patch \ 1518 %D%/packages/patches/gnumach-version.patch \
1519 %D%/packages/patches/gnupg-default-pinentry.patch \ 1519 %D%/packages/patches/gnupg-default-pinentry.patch \
1520 %D%/packages/patches/gnupg-1-build-with-gcc10.patch \ 1520 %D%/packages/patches/gnupg-1-build-with-gcc10.patch \
1521 %D%/packages/patches/gnutls-skip-trust-store-test.patch \
1522 %D%/packages/patches/gnutls-no-which.patch \ 1521 %D%/packages/patches/gnutls-no-which.patch \
1523 %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \ 1522 %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
1524 %D%/packages/patches/gobject-introspection-absolute-shlib-path-1.72.patch \ 1523 %D%/packages/patches/gobject-introspection-absolute-shlib-path-1.72.patch \
diff --git a/gnu/packages/patches/gnutls-skip-trust-store-test.patch b/gnu/packages/patches/gnutls-skip-trust-store-test.patch
deleted file mode 100644
index e0536712a59..00000000000
--- a/gnu/packages/patches/gnutls-skip-trust-store-test.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Version 3.5.11 added a test to check that the default trust store is readable.
2It does not exist in the build environment, so pretend everything is fine.
3
4diff a/tests/trust-store.c b/tests/trust-store.c
5--- a/tests/trust-store.c
6+++ b/tests/trust-store.c
7@@ -61,7 +61,7 @@
8 } else if (ret < 0) {
9 fail("error loading system trust store: %s\n", gnutls_strerror(ret));
10 } else if (ret == 0) {
11- fail("no certificates were found in system trust store!\n");
12+ success("no trust store in the Guix build environment!\n");
13 }
14
15 gnutls_certificate_free_credentials(x509_cred);
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 6cdbbec9a87..ed942e2df59 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -217,8 +217,7 @@ living in the same process.")
217 (uri (string-append "mirror://gnupg/gnutls/v" 217 (uri (string-append "mirror://gnupg/gnutls/v"
218 (version-major+minor version) 218 (version-major+minor version)
219 "/gnutls-" version ".tar.xz")) 219 "/gnutls-" version ".tar.xz"))
220 (patches (search-patches "gnutls-no-which.patch" 220 (patches (search-patches "gnutls-no-which.patch"))
221 "gnutls-skip-trust-store-test.patch"))
222 (sha256 221 (sha256
223 (base32 222 (base32
224 "1v9090cbajf02cw01idfbp0cgmgjn5091ff1b96hqryi0bc17qb9")))) 223 "1v9090cbajf02cw01idfbp0cgmgjn5091ff1b96hqryi0bc17qb9"))))
@@ -241,16 +240,11 @@ living in the same process.")
241 ;; ld.so.cache file. 240 ;; ld.so.cache file.
242 "--with-zlib=link" 241 "--with-zlib=link"
243 "--with-zstd=link" 242 "--with-zstd=link"
244 ;; GnuTLS doesn't consult any environment variables to specify 243 ;; Configure GnuTLS to use the p11-kit trust module by default,
245 ;; the location of the system-wide trust store. Instead it has a 244 ;; which is more flexible and knows to look at locations we've
246 ;; configure-time option. Unless specified, its configure script 245 ;; configured it to, on top of allowing users to configure it
247 ;; attempts to auto-detect the location by looking for common 246 ;; further.
248 ;; places in the file system, none of which are present in our 247 "--with-default-trust-store-pkcs11=pkcs11:")
249 ;; chroot build environment. If not found, then no default trust
250 ;; store is used, so each program has to provide its own
251 ;; fallback, and users have to configure each program
252 ;; independently. This seems suboptimal.
253 "--with-default-trust-store-dir=/etc/ssl/certs")
254 #:phases 248 #:phases
255 #~(modify-phases %standard-phases 249 #~(modify-phases %standard-phases
256 #$@(if (target-ppc32?) 250 #$@(if (target-ppc32?)