SSL connect error (35)

All of a sudden, I started getting this error and I can’t install/upgrade any packages. See the output below.

I think what happened was that I tried to upgrade all installed packages on my laptop (macOS) by doing:

nix-env --upgrade '*'

but there were a few packages that could be upgraded so I uninstall them. In particular, I think I uninstalled curl.

I rolled back to a few generations ago. However, that didn’t fix the problem. Please help!

$ nix-env -iA nixpkgs.fd
replacing old 'fd-8.6.0'
installing 'fd-8.7.1'
warning: error: unable to download 'https://cache.nixos.org/r9mc9912wb4v5nz564z8qyp4f42zz6kq.narinfo': SSL connect error (35); retrying in 305 ms
warning: error: unable to download 'https://cache.nixos.org/r9mc9912wb4v5nz564z8qyp4f42zz6kq.narinfo': SSL connect error (35); retrying in 603 ms
warning: error: unable to download 'https://cache.nixos.org/r9mc9912wb4v5nz564z8qyp4f42zz6kq.narinfo': SSL connect error (35); retrying in 1169 ms
warning: error: unable to download 'https://cache.nixos.org/r9mc9912wb4v5nz564z8qyp4f42zz6kq.narinfo': SSL connect error (35); retrying in 2308 ms
error: unable to download 'https://cache.nixos.org/r9mc9912wb4v5nz564z8qyp4f42zz6kq.narinfo': SSL connect error (35)

Are you connected to the internet through a proxy that requires you to add a certificate?

Have a look at the suggestions from: Install Nix rootless on rhel - #7 by badcold

@jduan-highnote did you ever solve this ?

Unfortunately not yet.

Still not working on my part as well at least not reproducible.

Adding the following data point, when exclusively on mobile data connection I can reliably run a command like the next, but as soon as wifi (over home router) comes into play, I get the ssl errors again:

NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt nix run .#setup --impure

(ran in phone’s nix-on-droid app)
#vdm

nix started working after I rebooted my laptop. I’m not exactly sure what made it work. It might’ve been something else I tried. But I’m super happy that it’s working again. I was afraid I might need to wipe out nix and reinstall it over the weekend.

Maybe a better solution than the environment variable: On my Arch Linux machine with nix installed it was enough to start my systemd-timesyncd.service that was not started for some reason anyway to make the errors disappear.

Had the issue on a non-NixOS system as well as on a nix-on-droid instance (android TM device) and for the latter I did set the ntp_server manually to fix the error (link).