You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then Riot.im is an Electron app, right? So you would need to add p11-kit support to Chromium (CrNet) if you expect it to be able to access host certificates. I don't think it uses OpenSSL.
Accessing host certificates requires use of the p11-kit server running on the host OS, so if your TLS library doesn't support using p11-kit as its trust store, this is simply not expected to work. So you should report a bug to Chrome (good luck with that) for Riot.im, not here.
It's true that OpenSSL is not expected to work either, though I think neither of your example apps use OpenSSL. Eventually, OpenSSL will be improved to support p11-kit. Once that happens, we will need to change freedesktop-sdk to build OpenSSL with p11-kit configured as its default trust, like we already do for GnuTLS. freedesktop-sdk also has NSS patched to use p11-kit, like Fedora does, so NSS should work too. (I think OpenSSL is the last remaining significant holdout that doesn't support using p11-kit as its trust store; eventually it will get fixed.)
So, expected to work:
Anything using GnuTLS, including all GNOME stuff and anything else that uses GLib sockets (glib-networking)
Anything using NSS, including Firefox
freedesktop-sdk only: libcurl (configured to use GnuTLS), and anything using libcurl
Not expected to work and not our problem:
Chrome/Electron stuff
Anything using OpenSSL
Fedora runtime only: libcurl (configured to use OpenSSL), and anything using libcurl
TL;DR: this bug should be closed, unless Firefox is still broken. (It should not be broken anymore.)
OK one last tip. If you want a workaround, then instead of Riot.im you can use Revolt, which just uses WebKitGTK to display the Riot website instead of Electron. That means you get GLib sockets -> glib-networking -> GnuTLS -> p11-kit which should have access to the host certificates.
There seem to be mechanisms to generate CA bundles for openssl & java & everything else in p11-kit: trust extract --format=openssl-bundle --filter=ca-anchors --overwrite /tmp/openssl-bundle.pem
As a distributor, the fd.o sdk can override /usr/libexec/p11-kit/trust-extact-compat, and then just run trust extract-compat. p11-kit runs this automatically whenever trust anchor is run, but I'm not sure how it handles the daemon/client relationship used by Flatpak.
@mcatanzaro All the SDKs have to do is run trust extract [...] at some point and then OpenSSL will use the system's CA certs, right? Or am I missing something. Just extract it into the correct place for OpenSSL inside of the runtime will pick it up
Edit: Or Flatpak can extract these on the host side and place them into, i.e. /run/flatpak/openssl-bundle.pem, and then bind-mount this into the runtime env
Yes, that would work, but it would conflict with the certificates provided by the runtime itself. The runtime would have to stop shipping its own certificates. I'm not sure whether that would be desirable or not. There would be... implications. :)
Proper fix is to finish and land openssl/openssl#8200 to bring openssl out of certificate dark ages and into modern times.
I think I hit this today. Trying to use firefox in a flatpak on f31 silverblue and I have system wide certs added to my host (to access websites hosted by my employer). These certs don't make it into the flatpak AFAICT.
Okay, so the thing is, OpenSSL clearly can access host certs as can GnuTLS. But curl appears to use both in a way that results in embedded CA certs being used. I don't understand why.
looks like "causes me to worry that libcurl is not designed to do the right thing" was entirely correct.
To be clear: we must get rid of --with-ca-bundle from curl.bst if we want curl to have any chance at using host certificates (and we almost surely do want that). That does exactly what it says: it forces curl to use certs from the bundle installed in the runtime, rather than the host.
That said, I see this warning in the buildstream element:
# Curl must be configured --with-ca-bundle in order to find the
# correct certificate bundle at runtime, which is later generated
# by update-ca-certificates. Other applications such as git, rely
# on curl knowing the default location of the certs.
which indicates that libcurl defaults to using no certs at all? That doesn't sound right. If that's still true, it would be a curl bug IMO: it should default to using the system trust, not no trust at all.
How this is supposed to work is flatpak drops a configuration fragment under /etc which makes p11kit under flatpak use host trust store. curl is already linked against p11kit. Curl is a bit weird since it builds against both nss and GnuTLS and builds a dependency on p11kit on both directions.
Looks like for possibly historic reasons curl also links against OpenSSL and has OpenSSL backend which will not result in a working p11kit host cert usage if that ends up being used.
For avoidance of doubt: curl lets you choose the TLS backend at build time. Normally you would pick just one. Don't expect any consistency between distros here. Debian builds all three and lets applications pick which one they want; only one of them gets used by default, but I don't remember which. Fedora used to use NSS (I think) but nowadays uses OpenSSL. I see freedesktop-sdk uses both NSS and GnuTLS, and I'm not sure why. My suggestion would be to drop the NSS support and see if anything breaks: my guess is probably not. Sorry, after discussing with @nanonyme I see freedesktop-sdk actually builds all three and lets applications pick, just like Debian, but OpenSSL is default.
FWIW freedesktop-sdk 21.08 is going to carry libp11 to make OpenSSL hopefully play ball with p11kit. First beta is going to be done real soon.
If you've got OpenSSL hooked up to p11-kit, then that's cool. p11-kit is the primary reason to prefer GnuTLS vs. OpenSSL.
Of these three, NSS would be the least-preferred backend.
P.S. It seems I've requested this bug be closed multiple times in prior comments, since its scope is too broad and it's obviously not a flatpak issue. The flatpak issue tracker would be more useful if misplaced issues were closed more aggressively.
Well, it defaults to trying to figure out where platform-specific CA bundle is. I'm currently trying to build curl with --without-ca-bundle to disable its bundle logic completely. Note that currently OpenSSL, GnuTLS and NSS should be using p11kit correctly. So backend shouldn't matter as long as curl doesn't try to tell crypto library to use the runtime CA bundle.
Just wanted to mention that I am having this certificate issue with the Zoom flatpak app.
It is not honoring the certificate store of my system.
Ubuntu 22.04.
For the record, --with-ca-fallback in combination with -without-ca-bundle was the right solution. Not all apps will ever work correctly if they have eg bundled curl.
For the record, --with-ca-fallback in combination with -without-ca-bundle was the right solution. Not all apps will ever work correctly if they have eg bundled curl.
As a home user without a technical background, is there anything I can do about this, on my side? I don't understand the terms you mentioned.
As a home user without a technical background, is there anything I can do about this, on my side?
Not really, other than reporting it as a bug to the apps that are affected if nobody else has already done so.
(The maintainers of the Flathub package for Zoom probably cannot fix it, because Zoom is proprietary software, but at least having a bug report would record that limitation.)
It seems I've requested this bug be closed multiple times in prior comments, since its scope is too broad and it's obviously not a flatpak issue
Closing this as not Flatpak's bug.
What is now meant to happen is that apps (or the SSL/TLS libraries used by apps) should use p11-kit as their trust store. If they do that, then they will automatically pick up a socket forwarded by Flatpak from the host system, and trust whatever certificates the host trusts. If they do not do that, then that's a bug (or at least a limitation) in that app or the SSL/TLS library that it uses, and not a bug in Flatpak itself.
Activity
[-]Accessing Trusted Certificates from Host[/-][+]Accessing Host Trusted Certificates[/+]LorbusChris commentedon Mar 27, 2019
Confirmed not to work on Fedora 29 standard as well.
TingPing commentedon Mar 27, 2019
Riot probably uses OpenSSL which doesn't respect PKI anyway AFIAK. Firefox should though.
LorbusChris commentedon Mar 27, 2019
Right, that could be, as I only reproduced it with Riot this time. Firefox Nightlies aren't up to date at the moment, so I didn't test that.
Any idea how this could be made compatible with OpenSSL?
TingPing commentedon Mar 28, 2019
Hmm, it looks like Fedora builds openssl with
--openssldir=/etc/pki/tlswhile freedesktop-sdk has the default/etc/ssl. So that is probably relevant.EDIT: Grepping around Flatpak doesn't seem to expose the pki dirs anyway. I thought there was some work on doing so though...
matthiasclasen commentedon Mar 28, 2019
@amigadave is this something you could look into for our fedora flatpak builds ?
mcatanzaro commentedon Aug 8, 2019
I think Firefox should be fixed nowadays, since https://gitlab.com/freedesktop-sdk/freedesktop-sdk/commit/a11bd7c94e163b34e4ac209361c47f914997932f, which is in 18.08. Can you confirm?
Then Riot.im is an Electron app, right? So you would need to add p11-kit support to Chromium (CrNet) if you expect it to be able to access host certificates. I don't think it uses OpenSSL.
Accessing host certificates requires use of the p11-kit server running on the host OS, so if your TLS library doesn't support using p11-kit as its trust store, this is simply not expected to work. So you should report a bug to Chrome (good luck with that) for Riot.im, not here.
It's true that OpenSSL is not expected to work either, though I think neither of your example apps use OpenSSL. Eventually, OpenSSL will be improved to support p11-kit. Once that happens, we will need to change freedesktop-sdk to build OpenSSL with p11-kit configured as its default trust, like we already do for GnuTLS. freedesktop-sdk also has NSS patched to use p11-kit, like Fedora does, so NSS should work too. (I think OpenSSL is the last remaining significant holdout that doesn't support using p11-kit as its trust store; eventually it will get fixed.)
So, expected to work:
Not expected to work and not our problem:
TL;DR: this bug should be closed, unless Firefox is still broken. (It should not be broken anymore.)
mcatanzaro commentedon Aug 8, 2019
Note: this will be using CrNet, and beneath that, BoringSSL. It's probably bundled in the Chromium source code under third_party/.
mcatanzaro commentedon Aug 8, 2019
OK one last tip. If you want a workaround, then instead of Riot.im you can use Revolt, which just uses WebKitGTK to display the Riot website instead of Electron. That means you get GLib sockets -> glib-networking -> GnuTLS -> p11-kit which should have access to the host certificates.
AdrianVovk commentedon Sep 2, 2019
There seem to be mechanisms to generate CA bundles for openssl & java & everything else in p11-kit:
trust extract --format=openssl-bundle --filter=ca-anchors --overwrite /tmp/openssl-bundle.pemAs a distributor, the fd.o sdk can override /usr/libexec/p11-kit/trust-extact-compat, and then just run
trust extract-compat. p11-kit runs this automatically whenevertrust anchoris run, but I'm not sure how it handles the daemon/client relationship used by Flatpak.mcatanzaro commentedon Sep 2, 2019
Not sure I understand. How could that help?
AdrianVovk commentedon Sep 2, 2019
@mcatanzaro All the SDKs have to do is run
trust extract [...]at some point and then OpenSSL will use the system's CA certs, right? Or am I missing something. Just extract it into the correct place for OpenSSL inside of the runtime will pick it upEdit: Or Flatpak can extract these on the host side and place them into, i.e.
/run/flatpak/openssl-bundle.pem, and then bind-mount this into the runtime envmcatanzaro commentedon Sep 2, 2019
Yes, that would work, but it would conflict with the certificates provided by the runtime itself. The runtime would have to stop shipping its own certificates. I'm not sure whether that would be desirable or not. There would be... implications. :)
Proper fix is to finish and land openssl/openssl#8200 to bring openssl out of certificate dark ages and into modern times.
AdrianVovk commentedon Sep 3, 2019
@mcatanzaro That's fair
dustymabe commentedon Oct 27, 2019
I think I hit this today. Trying to use firefox in a flatpak on f31 silverblue and I have system wide certs added to my host (to access websites hosted by my employer). These certs don't make it into the flatpak AFAICT.
33 remaining items
j1mc commentedon Sep 9, 2021
It looks like freedesktop-sdk release versions 21.08 and 21.08.1 were tagged within the last week.
Can anyone verify if the issue is resolved or if it still persists?
nanonyme commentedon Dec 18, 2021
Okay, so the thing is, OpenSSL clearly can access host certs as can GnuTLS. But curl appears to use both in a way that results in embedded CA certs being used. I don't understand why.
nanonyme commentedon Dec 18, 2021
You can observe this by that currently with org.freedesktop.Platform//21.08
curl -L https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xzfailsCURL_SSL_BACKEND=gnutls curl -L https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xzfailsgnutls-cli --ca-verification mesa.freedesktop.orgsucceedsopenssl s_client -connect mesa.freedesktop.org:443succeedsSo remaining problem is clearly making curl not do something stupid. Crypto libraries work fine, curl does not.
nanonyme commentedon Dec 18, 2021
@mcatanzaro looks like "causes me to worry that libcurl is not designed to do the right thing" was entirely correct.
mcatanzaro commentedon Dec 18, 2021
To be clear: we must get rid of
--with-ca-bundlefrom curl.bst if we want curl to have any chance at using host certificates (and we almost surely do want that). That does exactly what it says: it forces curl to use certs from the bundle installed in the runtime, rather than the host.That said, I see this warning in the buildstream element:
which indicates that libcurl defaults to using no certs at all? That doesn't sound right. If that's still true, it would be a curl bug IMO: it should default to using the system trust, not no trust at all.
For avoidance of doubt: curl lets you choose the TLS backend at build time. Normally you would pick just one. Don't expect any consistency between distros here. Debian builds all three and lets applications pick which one they want; only one of them gets used by default, but I don't remember which. Fedora used to use NSS (I think) but nowadays uses OpenSSL.
I see freedesktop-sdk uses both NSS and GnuTLS, and I'm not sure why. My suggestion would be to drop the NSS support and see if anything breaks: my guess is probably not.Sorry, after discussing with @nanonyme I see freedesktop-sdk actually builds all three and lets applications pick, just like Debian, but OpenSSL is default.If you've got OpenSSL hooked up to p11-kit, then that's cool. p11-kit is the primary reason to prefer GnuTLS vs. OpenSSL.
Of these three, NSS would be the least-preferred backend.
P.S. It seems I've requested this bug be closed multiple times in prior comments, since its scope is too broad and it's obviously not a flatpak issue. The flatpak issue tracker would be more useful if misplaced issues were closed more aggressively.
nanonyme commentedon Dec 18, 2021
Well, it defaults to trying to figure out where platform-specific CA bundle is. I'm currently trying to build curl with
--without-ca-bundleto disable its bundle logic completely. Note that currently OpenSSL, GnuTLS and NSS should be using p11kit correctly. So backend shouldn't matter as long as curl doesn't try to tell crypto library to use the runtime CA bundle.nanonyme commentedon Dec 18, 2021
I would also note that currently curl does the wrong thing even with GnuTLS backend.
mcatanzaro commentedon Dec 18, 2021
I believe so, yes. Certainly that is correct for GnuTLS.
shmu26 commentedon Aug 25, 2022
Just wanted to mention that I am having this certificate issue with the Zoom flatpak app.
It is not honoring the certificate store of my system.
Ubuntu 22.04.
nanonyme commentedon Aug 25, 2022
For the record, --with-ca-fallback in combination with -without-ca-bundle was the right solution. Not all apps will ever work correctly if they have eg bundled curl.
shmu26 commentedon Aug 25, 2022
As a home user without a technical background, is there anything I can do about this, on my side? I don't understand the terms you mentioned.
nanonyme commentedon Aug 25, 2022
I mean, fix has been done. Runtime and flatpak work correctly. Remaining bugs are on app side and this should be closed.
smcv commentedon Aug 25, 2022
Not really, other than reporting it as a bug to the apps that are affected if nobody else has already done so.
(The maintainers of the Flathub package for Zoom probably cannot fix it, because Zoom is proprietary software, but at least having a bug report would record that limitation.)
Closing this as not Flatpak's bug.
What is now meant to happen is that apps (or the SSL/TLS libraries used by apps) should use p11-kit as their trust store. If they do that, then they will automatically pick up a socket forwarded by Flatpak from the host system, and trust whatever certificates the host trusts. If they do not do that, then that's a bug (or at least a limitation) in that app or the SSL/TLS library that it uses, and not a bug in Flatpak itself.
merlinz01 commentedon Mar 25, 2026
For folks landing here trying to figure out how to get a Go or NodeJS program inside Flatpak to trust a custom root certificate, try this workaround:
/home/yourusername/.local/share/root-ca.pem.flatpak override --user --env=SSL_CERT_FILE=/home/yourusername/.local/share/root-ca.pem <flatpak-app-id>.flatpak override --user --env=NODE_EXTRA_CA_CERTS=/home/yourusername/.local/share/root-ca.pem <flatpak-app-id>.