You are not logged in.

#1 2023-11-30 07:17:44

pasturegliding
Member
Registered: 2022-03-24
Posts: 24

[SOLVED] `curl: (77) error setting certificate file`

I was fooling around with the guix package manager, but I uninstalled it, and now I can't figure out how to use curl because it is looking for certificates in the guix-profile path that no longer exists.

$ curl -vI https://archlinux.org

*   Trying [2a01:4f9:c010:6b1f::1]:443...
*   Trying 95.217.163.246:443...
* Connected to archlinux.org (95.217.163.246) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* error setting certificate file: /home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt
* error setting certificate file: /home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt
* Closing connection
* error setting certificate file: /home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt
* error setting certificate file: /home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt
curl: (77) error setting certificate file: /home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt

I do not remember ever changing any config files to use the guix path instead of the default path.

Things I have tried:
1. Looking for a path in the

curl-config

page
2. doing

grep

on

/

for any file containing "guix-profile" (no matches)
3. reinstalling ca-certificates
4. forcibly uninstalling, reinstalling from cache, (causing a conflict error, so I overwrote everything with

pacman -S --overwrite "*curl*"

)

I have no idea why curl even knows I had guix anymore at this point. Not sure what my next step should be.

Last edited by pasturegliding (2023-11-30 09:42:10)

Offline

#2 2023-11-30 08:25:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,840

Re: [SOLVED] `curl: (77) error setting certificate file`

printenv

Ftr, "curl-config --ca" says "/etc/ssl/certs/ca-certificates.crt"?

Offline

#3 2023-11-30 08:32:28

pasturegliding
Member
Registered: 2022-03-24
Posts: 24

Re: [SOLVED] `curl: (77) error setting certificate file`

seth wrote:
printenv

Ftr, "curl-config --ca" says "/etc/ssl/certs/ca-certificates.crt"?

`curl-config --ca` does say "/etc/ssl/certs/ca-certificates.crt".

The `printenv` command is exactly the command I needed.

$ printenv | grep "guix"
GIT_SSL_CAINFO=/home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt
SSL_CERT_DIR=/home/pasture/.guix-profile/etc/ssl/certs
SSL_CERT_FILE=/home/pasture/.guix-profile/etc/ssl/certs/ca-certificates.crt

No idea where these variables are being set, but they're not in my .xprofile/bashrc/etc. I have run unset on all of them, and the curl command works properly now.

How do I find out which file is exporting these?

Last edited by pasturegliding (2023-11-30 08:38:14)

Offline

#4 2023-11-30 08:35:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,840

Re: [SOLVED] `curl: (77) error setting certificate file`

pacman -Qikk ca-certificates-utils

You'll have to fix that file "somehow" (either you've the package cached or you need to download and usb-walk it onto the system or use some live distro or get it via plain http)

No idea where these variables are being set, but they're not in my .xprofile/bashrc/etc.

Remnants? Did you re-login?

Offline

#5 2023-11-30 08:41:03

pasturegliding
Member
Registered: 2022-03-24
Posts: 24

Re: [SOLVED] `curl: (77) error setting certificate file`

seth wrote:
pacman -Qikk ca-certificates-utils

You'll have to fix that file "somehow" (either you've the package cached or you need to download and usb-walk it onto the system or use some live distro or get it via plain http)

No idea where these variables are being set, but they're not in my .xprofile/bashrc/etc.

Remnants? Did you re-login?

I fixed the file easily, I just had to re-install ca-certificates, ca-certificates-utils, and ca-certificates-mozilla then I did sudo update-ca-trust, and that re-generated the file for me. Not sure what happened, but it's there now.

I have re-logged in

Offline

#6 2023-11-30 08:50:55

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,840

Re: [SOLVED] `curl: (77) error setting certificate file`

grep /etc and $HOME for one of the variable names, not specific value tokens (those can easily be dynamic)

Offline

#7 2023-11-30 09:41:43

pasturegliding
Member
Registered: 2022-03-24
Posts: 24

Re: [SOLVED] `curl: (77) error setting certificate file`

I found a loop in the bashrc where I put a comment to remind myself that it was put there by guix (didn't work lol) and when I deleted that and sourced the bashrc again, the environment variable was gone. Thanks. I'll mark it solved

I also found this command to say where variables are being assigned from.

PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2

Offline

Board footer

Powered by FluxBB