guile-gnutls does not set up search paths for the certificates

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 months ago
(address . bug-guix@gnu.org)
87ikpzhq1q.fsf@wolfsden.cz
When trying to use (web client) Guile module, one gets the following
error:

Toggle snippet (24 lines)
$ guix shell -CN guile guile-gnutls nss-certs -- guile -c '((@ (web client) http-get) "https://gnu.org")'
Backtrace:
In ice-9/boot-9.scm:
1752:10 7 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
6 (apply-smob/0 #<thunk 7f625f6c1300>)
In ice-9/boot-9.scm:
724:2 5 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
619:8 4 (_ #(#(#<directory (guile-user) 7f625f6c4c80>)))
In ice-9/command-line.scm:
185:19 3 (_ #<input: string 7f625f6be850>)
In unknown file:
2 (eval ((@ (web client) http-get) "https://gnu.org") #<d?>)
In web/client.scm:
576:0 1 (http-get "https://gnu.org" #:body _ # _ #:port _ # #<?> ?)
286:6 0 (tls-wrap #<closed: file 7f6256da2c40> _ # _)

web/client.scm:286:6: In procedure tls-wrap:
X.509 certificate of 'gnu.org' could not be verified:
signer-not-found invalid


It seems that guile-gnutls fails to find the certificates, which is
unexpected. Adding `curl' into the list of packages works around the
problem:

Toggle snippet (3 lines)
$ guix shell -CN guile guile-gnutls nss-certs curl -- guile -c '((@ (web client) http-get) "https://gnu.org")'

We can see the difference boils down to different search paths:

Toggle snippet (6 lines)
$ guix shell -CN guile guile-gnutls nss-certs --search-paths
export PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/bin${PATH:+:}$PATH"
export GUILE_LOAD_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/lib/guile/3.0/site-ccache:/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

and

Toggle snippet (9 lines)
$ guix shell -CN guile guile-gnutls nss-certs curl --search-paths
export PATH="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/bin${PATH:+:}$PATH"
export SSL_CERT_DIR="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/etc/ssl/certs"
export SSL_CERT_FILE="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/etc/ssl/certs/ca-certificates.crt"
export CURL_CA_BUNDLE="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/etc/ssl/certs/ca-certificates.crt"
export GUILE_LOAD_PATH="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/lib/guile/3.0/site-ccache:/gnu/store/6zbi90idpfww3y4k7bcnm38lwilnxiql-profile/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

I think guile-gnutls should also declare the SSL_* variables, since it
needs the certificates for vast majority of things one could want to do
with it..

Have a nice day,
Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmeYAuEOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/walKnhAAgMHr0fRFxh6x4Ghh5q0ts2XClSI7m4yfdz4S
q7hicMaz6fKlS9PJMYTrTOlskAn48NvfLV7dGoCLrMIZrqPZRc8+BvnsvoJJgoU6
BAK6+F0zBPFSEpu60tm1AKQp6ZMGJ9gGWPgOAVwt3a9A6ZciiAcY+sgq8WLRd6bU
LegyE0ePZFXq6WAACMDijO5NBf45V4FSIlA6bWWkFkYI7KalsjJlCC8DYvOC+D9+
x1BlMVPQ7hnCVj5DW3bqA1FpT6BXYO6GTs9U0njaKCYtbD7jPQO8vmH21u38qcoe
6c0nqXBTR6EoyBRXv0pquKXz6nXr30Obi3TAecw1jSuODoRhWto8Rb6HQVmPN8VV
Bp6Sieyunl/RnF2NEIu2FUmSc6qrpwm4qGSGC0GECVaONH346ZBQWR9+q4tUNn2M
W0DA9MUT+XxnAICREZW8llYI9q4QK4qs5pNEzt1QpicxJIqchcyY9mjwMX7JCyQj
2eJiRnqvXRkgs/LdDJh2wHMdJlBgqK56iKKDAgCxErgCvH4aTyBttLC/0AGtmRYY
EzEV4Imillt4uSoSwLyPWMOcTzVpSr2NxkpnTHMJk6aJlpfIYlVVSy2L0SKUWK+0
ATFbSqlXYQF0/p0aUY0yw4PBzAIypE8Pwf5VMVuPzmMnVIvPVZF8UvZ81XiZbwFC
SdRI8js=
=hLQN
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 3 weeks ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 75902@debbugs.gnu.org)
87bjv2x6j0.fsf@gnu.org
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (7 lines)
> We can see the difference boils down to different search paths:
>
> $ guix shell -CN guile guile-gnutls nss-certs --search-paths
> export PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/bin${PATH:+:}$PATH"
> export GUILE_LOAD_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
> export GUILE_LOAD_COMPILED_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/lib/guile/3.0/site-ccache:/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

GnuTLS (and thus Guile-GnuTLS) does not honor an environment variable.
Instead it’s up to applications to set up their certificate search path.

See for example the discussion at https://issues.guix.gnu.org/46779.

Thanks,
Ludo’.
Tomas Volf wrote 3 weeks ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 75902@debbugs.gnu.org)
87v7ta69ra.fsf@wolfsden.cz
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (17 lines)
> Hi,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>> We can see the difference boils down to different search paths:
>>
>> $ guix shell -CN guile guile-gnutls nss-certs --search-paths
>> export PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/bin${PATH:+:}$PATH"
>> export GUILE_LOAD_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
>> export
>> GUILE_LOAD_COMPILED_PATH="/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/lib/guile/3.0/site-ccache:/gnu/store/gg2qybb41rpcl0fs4ay98s2q3m2mcbyz-profile/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
>
> GnuTLS (and thus Guile-GnuTLS) does not honor an environment variable.
> Instead it’s up to applications to set up their certificate search path.
>
> See for example the discussion at <https://issues.guix.gnu.org/46779>.

Thank you for the link. However after reading through it, and basing on
your sentence above, is the guile-gnutls not in a position to be
considered "application" that should configure the certificate search
path?

Or to put this in other words, when I want to use guile-gnutls from
REPL, what is the "application" that should configure the the search
path, if not guile-gnutls itself?

Have a nice day,
Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmexKhkOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wal01RAAiTGskDEigP55CLUbF8mvSouStfmJ4gb/o7eS
e7XpRmSFPMDkiq4mEqdWIYmRhjFCLm0FGcBPM+dOEOpQOJbjMmfKwcyUSGDTnm7q
LBw/0nBjM004cLkIte21FbNo+3Au6ttr1CGgjeVDefhKxPi6Gc41QoNV41Ta0KS4
4bcw5uWcovm4akAQgGKYmzv9koL0jXdKBtym/083Js8hUvDeatKF0hh/4wyQqLD+
t4K2fqH6GfAh5r4XLss4ctCOWfj/D7xUZ7SF8YgSNZAbjyVB5R3S/i7NVuM7qbE+
3LnhWMMKbu54X+dkfhc+YpXuKMOT9cKtcD+mISBkgabeQ1I9oiX4KIwtW51GfH9q
foHAZ86boS8T94cl1aR775OW0A3rGIL2bPljRBsoneKT7xs0fWXuBBq6iqvdkXty
ze1cr7tx0BXkz2dQwkdhd3N8xNb7ZtW2hpLmGbJy/ipHGVdZXbXEvu4z5UYL0B62
6UbVjvPFKJuqfZ4YGaC00MNzoUlLoQigzune/GifBRYuZtNGPFXH4jtLw7DxSCui
ocrNnr4SwtvAcOrQw45RJr30clfHQkdEI1493i22OV4xnK6yVKdvQQxcbG9BaBsv
JtdF4J4sNi50BUPKna+52FzL0rYhwC0d3doaNVL3LJKpornJ2G/k6UeSANFgI0wa
C6gaPkE=
=h61k
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 3 weeks ago
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 75902@debbugs.gnu.org)
875xl3d2w2.fsf@gnu.org
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (10 lines)
>> GnuTLS (and thus Guile-GnuTLS) does not honor an environment variable.
>> Instead it’s up to applications to set up their certificate search path.
>>
>> See for example the discussion at <https://issues.guix.gnu.org/46779>.
>
> Thank you for the link. However after reading through it, and basing on
> your sentence above, is the guile-gnutls not in a position to be
> considered "application" that should configure the certificate search
> path?

Well yes, we can do anything we want. My take on this is that bindings
should remain close to the library they’re wrapping, generally speaking,
to avoid bad surprises.

I think certificate search should either but up to actual applications
(like Guix), as is the case now, or changed in GnuTLS proper. Doing it
in guile-gnutls just because we can easily do so doesn’t sound like a
good idea to me.

WDYT?

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75902@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75902
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help