Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: carry over (NIX_)SSL_CERT_FILE to devbox shells (#178)
When `NIX_SSL_CERT_FILE` and `SSL_CERT_FILE` aren't explicitly set, `nix-shell --pure` sets them to invalid paths (specifically "/no-cert-file.crt") to ensure that openssl doesn't use certificates that live outside of the current Nix environment. This causes HTTPS requests in most programs to fail. For example: (devbox) $ curl https://google.com curl: (77) error setting certificate verify locations: CAfile: /no-cert-file.crt CApath: none This is pretty inconvenient for development, so we want to undo those changes when launching a devbox shell. To do that, we: 1. Keep any `NIX_SSL_CERT_FILE` and `SSL_CERT_FILE` values that are set in the parent shell. 2. Unset `NIX_SSL_CERT_FILE` or `SSL_CERT_FILE` when they're set to the "/no-cert-file.crt" value set by `nix-shell`. This causes openssl to go back to using the default paths. NIX_SSL_CERT_FILE is used by some programs installed by Nix. SSL_CERT_FILE is used by non-Nix programs and some Nix programs. Fixes #177.
- Loading branch information