* [PATCH] gnutls: Add a config option to enable the pkcs11 trust store @ 2019-05-30 10:12 Philippe Normand 2019-05-30 11:38 ` Richard Purdie 2019-05-30 12:17 ` Adrian Bunk 0 siblings, 2 replies; 11+ messages in thread From: Philippe Normand @ 2019-05-30 10:12 UTC (permalink / raw) To: openembedded-core Since version 2.60 the glib-networking TLS database relies on GnuTLS's system trust store, so not enabling it leads to TLS errors in applications depending on glib-networking. The raised runtime warning is: process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load TLS database: Failed to load system trust store: GnuTLS was not configured with a system trust (app:490): ... TLS Error: TLS certificate has unknown CA. --- meta/recipes-support/gnutls/gnutls_3.6.7.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-support/gnutls/gnutls_3.6.7.bb b/meta/recipes-support/gnutls/gnutls_3.6.7.bb index e05dc2b57d..3ad6e56579 100644 --- a/meta/recipes-support/gnutls/gnutls_3.6.7.bb +++ b/meta/recipes-support/gnutls/gnutls_3.6.7.bb @@ -35,6 +35,8 @@ PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2" PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1" PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" +PACKAGECONFIG[pkcs11-trust-store] = "--with-default-trust-store-pkcs11=pkcs11:,," + EXTRA_OECONF = " \ --enable-doc \ -- 2.20.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 10:12 [PATCH] gnutls: Add a config option to enable the pkcs11 trust store Philippe Normand @ 2019-05-30 11:38 ` Richard Purdie 2019-05-30 11:43 ` Philippe Normand 2019-05-30 12:17 ` Adrian Bunk 1 sibling, 1 reply; 11+ messages in thread From: Richard Purdie @ 2019-05-30 11:38 UTC (permalink / raw) To: Philippe Normand, openembedded-core On Thu, 2019-05-30 at 11:12 +0100, Philippe Normand wrote: > Since version 2.60 the glib-networking TLS database relies on GnuTLS's system > trust store, so not enabling it leads to TLS errors in applications depending on > glib-networking. The raised runtime warning is: > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load TLS database: Failed to load system trust store: GnuTLS was not configured with a system trust > (app:490): ... TLS Error: TLS certificate has unknown CA. Doesn't this mean we should enable it by default as well? Cheers, Richard ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 11:38 ` Richard Purdie @ 2019-05-30 11:43 ` Philippe Normand 2019-05-30 11:46 ` richard.purdie 0 siblings, 1 reply; 11+ messages in thread From: Philippe Normand @ 2019-05-30 11:43 UTC (permalink / raw) To: Richard Purdie, openembedded-core On Thu, 2019-05-30 at 12:38 +0100, Richard Purdie wrote: > On Thu, 2019-05-30 at 11:12 +0100, Philippe Normand wrote: > > Since version 2.60 the glib-networking TLS database relies on > > GnuTLS's system > > trust store, so not enabling it leads to TLS errors in applications > > depending on > > glib-networking. The raised runtime warning is: > > > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load TLS > > database: Failed to load system trust store: GnuTLS was not > > configured with a system trust > > (app:490): ... TLS Error: TLS certificate has unknown CA. > > Doesn't this mean we should enable it by default as well? > Yes, I would likely support this decision. :) I didn't do it in the patch because I don't know all the consequences of enabling this by default. I would rather defer the decision to the recipe maintainer. Philippe ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 11:43 ` Philippe Normand @ 2019-05-30 11:46 ` richard.purdie 2019-05-30 12:04 ` Philippe Normand 0 siblings, 1 reply; 11+ messages in thread From: richard.purdie @ 2019-05-30 11:46 UTC (permalink / raw) To: Philippe Normand, openembedded-core On Thu, 2019-05-30 at 12:43 +0100, Philippe Normand wrote: > On Thu, 2019-05-30 at 12:38 +0100, Richard Purdie wrote: > > On Thu, 2019-05-30 at 11:12 +0100, Philippe Normand wrote: > > > Since version 2.60 the glib-networking TLS database relies on > > > GnuTLS's system > > > trust store, so not enabling it leads to TLS errors in > > > applications > > > depending on > > > glib-networking. The raised runtime warning is: > > > > > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load > > > TLS > > > database: Failed to load system trust store: GnuTLS was not > > > configured with a system trust > > > (app:490): ... TLS Error: TLS certificate has unknown CA. > > > > Doesn't this mean we should enable it by default as well? > > > > Yes, I would likely support this decision. :) > > I didn't do it in the patch because I don't know all the consequences > of enabling this by default. I would rather defer the decision to the > recipe maintainer. Given we're seeing issues without it enabled, can you send a v2 with it being enabled by default please? We try not to do that where it adds dependencies we don't need but it seems to make sense here to me (I can take repsonsibilty for asking for it!). Cheers, Richard ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 11:46 ` richard.purdie @ 2019-05-30 12:04 ` Philippe Normand 0 siblings, 0 replies; 11+ messages in thread From: Philippe Normand @ 2019-05-30 12:04 UTC (permalink / raw) To: richard.purdie, openembedded-core On Thu, 2019-05-30 at 12:46 +0100, richard.purdie@linuxfoundation.org wrote: > On Thu, 2019-05-30 at 12:43 +0100, Philippe Normand wrote: > > On Thu, 2019-05-30 at 12:38 +0100, Richard Purdie wrote: > > > On Thu, 2019-05-30 at 11:12 +0100, Philippe Normand wrote: > > > > Since version 2.60 the glib-networking TLS database relies on > > > > GnuTLS's system > > > > trust store, so not enabling it leads to TLS errors in > > > > applications > > > > depending on > > > > glib-networking. The raised runtime warning is: > > > > > > > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load > > > > TLS > > > > database: Failed to load system trust store: GnuTLS was not > > > > configured with a system trust > > > > (app:490): ... TLS Error: TLS certificate has unknown CA. > > > > > > Doesn't this mean we should enable it by default as well? > > > > > > > Yes, I would likely support this decision. :) > > > > I didn't do it in the patch because I don't know all the > > consequences > > of enabling this by default. I would rather defer the decision to > > the > > recipe maintainer. > > Given we're seeing issues without it enabled, can you send a v2 with > it > being enabled by default please? > > We try not to do that where it adds dependencies we don't need but it > seems to make sense here to me (I can take repsonsibilty for asking > for > it!). > Alright, I'll update the patch then. Enabling this new option requires the p11-kit option to be enabled as well though. Philippe ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 10:12 [PATCH] gnutls: Add a config option to enable the pkcs11 trust store Philippe Normand 2019-05-30 11:38 ` Richard Purdie @ 2019-05-30 12:17 ` Adrian Bunk 2019-05-30 13:30 ` Philippe Normand 1 sibling, 1 reply; 11+ messages in thread From: Adrian Bunk @ 2019-05-30 12:17 UTC (permalink / raw) To: Philippe Normand; +Cc: openembedded-core On Thu, May 30, 2019 at 11:12:21AM +0100, Philippe Normand wrote: > Since version 2.60 the glib-networking TLS database relies on GnuTLS's system > trust store, so not enabling it leads to TLS errors in applications depending on > glib-networking. The raised runtime warning is: > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load TLS database: Failed to load system trust store: GnuTLS was not configured with a system trust > (app:490): ... TLS Error: TLS certificate has unknown CA. > --- > meta/recipes-support/gnutls/gnutls_3.6.7.bb | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/meta/recipes-support/gnutls/gnutls_3.6.7.bb b/meta/recipes-support/gnutls/gnutls_3.6.7.bb > index e05dc2b57d..3ad6e56579 100644 > --- a/meta/recipes-support/gnutls/gnutls_3.6.7.bb > +++ b/meta/recipes-support/gnutls/gnutls_3.6.7.bb > @@ -35,6 +35,8 @@ PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2" > PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1" > PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" > PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" > +PACKAGECONFIG[pkcs11-trust-store] = "--with-default-trust-store-pkcs11=pkcs11:,," >... Two questions: 1. Is this a valid pkcs11 URI? AC_ARG_WITH([default-trust-store-pkcs11], [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI], [use the given pkcs11 uri as default trust store])]) 2. Wouldn't the more common case be to use the ca-certificates package instead of PKCS #11? cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 12:17 ` Adrian Bunk @ 2019-05-30 13:30 ` Philippe Normand 2019-05-30 14:06 ` Adrian Bunk 0 siblings, 1 reply; 11+ messages in thread From: Philippe Normand @ 2019-05-30 13:30 UTC (permalink / raw) To: Adrian Bunk; +Cc: openembedded-core Hi Adrian, On Thu, 2019-05-30 at 15:17 +0300, Adrian Bunk wrote: > On Thu, May 30, 2019 at 11:12:21AM +0100, Philippe Normand wrote: > > Since version 2.60 the glib-networking TLS database relies on > > GnuTLS's system > > trust store, so not enabling it leads to TLS errors in applications > > depending on > > glib-networking. The raised runtime warning is: > > > > process:500): GLib-Net-WARNING **: 09:14:09.321: Failed to load TLS > > database: Failed to load system trust store: GnuTLS was not > > configured with a system trust > > (app:490): ... TLS Error: TLS certificate has unknown CA. > > ... > Two questions: > > 1. Is this a valid pkcs11 URI? > > AC_ARG_WITH([default-trust-store-pkcs11], > [AS_HELP_STRING([--with-default-trust-store-pkcs11=URI], > [use the given pkcs11 uri as default trust store])]) > Yes, I believe so. I simply used the same option as in the Freedesktop Flatpak SDK: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/master/elements/components/gnutls.bst > 2. Wouldn't the more common case be to use the ca-certificates > package instead of PKCS #11? > I don't know why glib-networking needs to go through gnutls which then needs to query p11-kit. I suppose p11-kit could directly be used, but this is not my call to make. For reference, this is the relevant glib-networking commit: https://gitlab.gnome.org/GNOME/glib-networking/commit/f1c8feee014007cc913b71357acb609f8d1200df Anyway, in my local config I had this: PACKAGECONFIG_append_pn-gnutls = " p11-kit pkcs11-trust-store" PACKAGECONFIG_append_pn-p11-kit = " trust-paths" Without those I would still get TLS errors at runtime. So these 3 options would need to be enabled by default, I'll send a follow-up patch series. Philippe ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 13:30 ` Philippe Normand @ 2019-05-30 14:06 ` Adrian Bunk 2019-05-30 14:47 ` Philippe Normand 0 siblings, 1 reply; 11+ messages in thread From: Adrian Bunk @ 2019-05-30 14:06 UTC (permalink / raw) To: Philippe Normand; +Cc: openembedded-core On Thu, May 30, 2019 at 02:30:14PM +0100, Philippe Normand wrote: > Hi Adrian, Hi Philippe, > On Thu, 2019-05-30 at 15:17 +0300, Adrian Bunk wrote: >... > > 2. Wouldn't the more common case be to use the ca-certificates > > package instead of PKCS #11? > > I don't know why glib-networking needs to go through gnutls which then > needs to query p11-kit. I suppose p11-kit could directly be used, but > this is not my call to make. >... I think your "which then needs to query p11-kit" is not correct. My reading of configure.ac is that ca-certificates could be used instead, and this also makes a lot more sense in the default case. > Philippe cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 14:06 ` Adrian Bunk @ 2019-05-30 14:47 ` Philippe Normand 2019-05-30 15:50 ` Richard Purdie 0 siblings, 1 reply; 11+ messages in thread From: Philippe Normand @ 2019-05-30 14:47 UTC (permalink / raw) To: Adrian Bunk; +Cc: openembedded-core On Thu, 2019-05-30 at 17:06 +0300, Adrian Bunk wrote: > On Thu, May 30, 2019 at 02:30:14PM +0100, Philippe Normand wrote: > > Hi Adrian, > > Hi Philippe, > > > On Thu, 2019-05-30 at 15:17 +0300, Adrian Bunk wrote: > > ... > > > 2. Wouldn't the more common case be to use the ca-certificates > > > package instead of PKCS #11? > > > > I don't know why glib-networking needs to go through gnutls which > > then > > needs to query p11-kit. I suppose p11-kit could directly be used, > > but > > this is not my call to make. > > ... > > I think your "which then needs to query p11-kit" is not correct. > > My reading of configure.ac is that ca-certificates could be used > instead, and this also makes a lot more sense in the default case. > I've asked Michael Catanzaro about this, he's not subscribed to this list so he can't reply to the thread. Here's his reply: The GnuTLS default trust store can be a certificate file bundle or a certificate directory (provided by ca-certificates), or a PKCS#11 URI, but PKCS#11 is a better default. If you do not use PKCS#11, then expected functionality like trusting and distrusting certificates using the 'trust' command or applications like seahorse will not work. Most modern Linux distributions are now using PKCS#11 URIs; the only major holdouts are Debian and Ubuntu. So I would definitely recommend the PKCS#11 URI. Of course, basic functionality will work whichever way you choose; glib-networking only requires that GnuTLS has a default trust store, one way or the other, so using a bundle would be OK if you want to avoid the dependency on p11-kit. --- So, do you agree about depending on p11-kit from now on? Philippe ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 14:47 ` Philippe Normand @ 2019-05-30 15:50 ` Richard Purdie 2019-05-30 16:44 ` Philippe Normand 0 siblings, 1 reply; 11+ messages in thread From: Richard Purdie @ 2019-05-30 15:50 UTC (permalink / raw) To: Philippe Normand, Adrian Bunk; +Cc: openembedded-core On Thu, 2019-05-30 at 15:47 +0100, Philippe Normand wrote: > On Thu, 2019-05-30 at 17:06 +0300, Adrian Bunk wrote: > > On Thu, May 30, 2019 at 02:30:14PM +0100, Philippe Normand wrote: > > > Hi Adrian, > > > > Hi Philippe, > > > > > On Thu, 2019-05-30 at 15:17 +0300, Adrian Bunk wrote: > > > ... > > > > 2. Wouldn't the more common case be to use the ca-certificates > > > > package instead of PKCS #11? > > > > > > I don't know why glib-networking needs to go through gnutls which > > > then > > > needs to query p11-kit. I suppose p11-kit could directly be used, > > > but > > > this is not my call to make. > > > ... > > > > I think your "which then needs to query p11-kit" is not correct. > > > > My reading of configure.ac is that ca-certificates could be used > > instead, and this also makes a lot more sense in the default case. > > > > I've asked Michael Catanzaro about this, he's not subscribed to this > list so he can't reply to the thread. Here's his reply: > > The GnuTLS default trust store can be a certificate file bundle or a > certificate directory (provided by ca-certificates), or a PKCS#11 > URI, > but PKCS#11 is a better default. If you do not use PKCS#11, then > expected functionality like trusting and distrusting certificates > using > the 'trust' command or applications like seahorse will not work. Most > modern Linux distributions are now using PKCS#11 URIs; the only major > holdouts are Debian and Ubuntu. So I would definitely recommend the > PKCS#11 URI. Of course, basic functionality will work whichever way > you > choose; glib-networking only requires that GnuTLS has a default trust > store, one way or the other, so using a bundle would be OK if you > want to avoid the dependency on p11-kit. I think most of our system is already using ca-certificates at this point so consistency here might make sense. If you use a PKCS#11 URI does that mean the systems would need network access to obtain the trust store? Ultimately we may want this to be a global config selection but using ca-certs and then having a wider discussion about a global option might make most sense. Cheers, Richard ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] gnutls: Add a config option to enable the pkcs11 trust store 2019-05-30 15:50 ` Richard Purdie @ 2019-05-30 16:44 ` Philippe Normand 0 siblings, 0 replies; 11+ messages in thread From: Philippe Normand @ 2019-05-30 16:44 UTC (permalink / raw) To: Richard Purdie, Adrian Bunk; +Cc: openembedded-core On Thu, 2019-05-30 at 16:50 +0100, Richard Purdie wrote: > On Thu, 2019-05-30 at 15:47 +0100, Philippe Normand wrote: > > On Thu, 2019-05-30 at 17:06 +0300, Adrian Bunk wrote: > > > On Thu, May 30, 2019 at 02:30:14PM +0100, Philippe Normand wrote: > > > > Hi Adrian, > > > > > > Hi Philippe, > > > > > > > On Thu, 2019-05-30 at 15:17 +0300, Adrian Bunk wrote: > > > > ... > > > > > 2. Wouldn't the more common case be to use the ca- > > > > > certificates > > > > > package instead of PKCS #11? > > > > > > > > I don't know why glib-networking needs to go through gnutls > > > > which > > > > then > > > > needs to query p11-kit. I suppose p11-kit could directly be > > > > used, > > > > but > > > > this is not my call to make. > > > > ... > > > > > > I think your "which then needs to query p11-kit" is not correct. > > > > > > My reading of configure.ac is that ca-certificates could be used > > > instead, and this also makes a lot more sense in the default > > > case. > > > > > > > I've asked Michael Catanzaro about this, he's not subscribed to > > this > > list so he can't reply to the thread. Here's his reply: > > > > The GnuTLS default trust store can be a certificate file bundle or > > a > > certificate directory (provided by ca-certificates), or a PKCS#11 > > URI, > > but PKCS#11 is a better default. If you do not use PKCS#11, then > > expected functionality like trusting and distrusting certificates > > using > > the 'trust' command or applications like seahorse will not work. > > Most > > modern Linux distributions are now using PKCS#11 URIs; the only > > major > > holdouts are Debian and Ubuntu. So I would definitely recommend the > > PKCS#11 URI. Of course, basic functionality will work whichever way > > you > > choose; glib-networking only requires that GnuTLS has a default > > trust > > store, one way or the other, so using a bundle would be OK if you > > want to avoid the dependency on p11-kit. > > I think most of our system is already using ca-certificates at this > point so consistency here might make sense. > I think this is the most sensible approach for now indeed. > If you use a PKCS#11 URI does that mean the systems would need > network > access to obtain the trust store? > The ca-certificates will still be used with a PKCS#11 trust store, just indirectly, via p11-kit. It doesn't require network access. > Ultimately we may want this to be a global config selection but using > ca-certs and then having a wider discussion about a global option > might > make most sense. > OK, I'll prepare a new patch then for gnutls to directly rely on ca- certificates, for the time being :) Thanks Richard and Adrian! Philippe ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-05-30 16:44 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-05-30 10:12 [PATCH] gnutls: Add a config option to enable the pkcs11 trust store Philippe Normand 2019-05-30 11:38 ` Richard Purdie 2019-05-30 11:43 ` Philippe Normand 2019-05-30 11:46 ` richard.purdie 2019-05-30 12:04 ` Philippe Normand 2019-05-30 12:17 ` Adrian Bunk 2019-05-30 13:30 ` Philippe Normand 2019-05-30 14:06 ` Adrian Bunk 2019-05-30 14:47 ` Philippe Normand 2019-05-30 15:50 ` Richard Purdie 2019-05-30 16:44 ` Philippe Normand
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox