# Ssl error when trying to use nix flake command directly

**URL:** <https://discourse.flox.dev/t/ssl-error-when-trying-to-use-nix-flake-command-directly/682>\
**Category:** Bug Reports\
**Created:** [March 8, 2023, 4:12am UTC](https://discourse.flox.dev/t/ssl-error-when-trying-to-use-nix-flake-command-directly/682 "2023-03-08T04:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Johnson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/paul_johnson/32/563_2.png) [@Paul\_Johnson](https://discourse.flox.dev/u/Paul_Johnson)\
**Post date:** [March 8, 2023, 4:12am UTC](https://discourse.flox.dev/t/ssl-error-when-trying-to-use-nix-flake-command-directly/682/1 "2023-03-08T04:12:55Z")

</div>

Hi there, this isn’t really a flox problem directly, but when I try to run nix flake and related commands directly using the nix cli installed by flox (not flox nix flake …) I’m getting ssl errors:

```auto
> nix develop
warning: Git tree '/Users/pauljohnson/Programming/blah' is dirty
warning: error: unable to download 'https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-beta-20221101212107.tar.gz': SSL connect error (35); retrying in 330 ms
warning: error: unable to download 'https://dl.google.com/dl/cloudsdk/channels/rapid/components/google-cloud-sdk-beta-20221101212107.tar.gz': SSL connect error (35); retrying in 597 ms

```

When I download the files in my browser or using curl it downloads correctly. This is on an m1 mac mini.

flake.nix:

```auto
{
  description = "blah";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
        let
            pkgs = nixpkgs.legacyPackages.${system};
            deps = with pkgs; [
                kubectl
                kubernetes-helm
                (google-cloud-sdk.withExtraComponents ([pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin]))
                terraform
                go
                cue
                devspace
                postgresql_13
                nodejs-16_x
            ];
        in {
            packages = deps;
            devShell = pkgs.mkShell { buildInputs = deps; };
        }
    );
}

```

---

<div class="post-metadata">

**Author:** ![tomberek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/tomberek/32/83_2.png) [@tomberek](https://discourse.flox.dev/u/tomberek)\
**Post date:** [March 8, 2023, 12:28pm UTC](https://discourse.flox.dev/t/ssl-error-when-trying-to-use-nix-flake-command-directly/682/2 "2023-03-08T12:28:07Z")

</div>

This happens when using Nix on its own. Upstream installation mitigates this by modifying your bashrc/zshrc and so forth. We’ve taken the approach of not modifying your startup files as that can lead to its own problems.

When using `flox develop` or `flox nix develop` we take care of this for you because we set the NIX\_SSL\_CERT\_FILE variable on your behalf (if it or SSL\_CERT\_FILE is not set already).

The references below show how to manually set this if you wish (for example: in order to set it to a custom organization-dependent certificate bundle).

References:

- [flox manual page | flox:docs](https://floxdev.com/docs/reference/man-pages/flox/#environment-variables)
- [Environment Variables - Nix Reference Manual](https://nixos.org/manual/nix/stable/installation/env-variables.html#nix_ssl_cert_file)
