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