[Nix-dev] How to add (self-signed) SSL certificate to NixOS?

Bjørn Forsman bjorn.forsman at gmail.com
Mon Feb 2 16:13:45 CET 2015


Hi,

(Warning: I'm a SSL/certificate newbie.)

I tried placing the certificate file (.crt) into /etc/ssl/certs/, next
to the existing ca-bundle.crt. That didn't work. Strace showed that
e.g. curl didn't even look at my file.

Then I tried to append the certificate contents to the ca-bundle.crt:

  environment.etc."ssl/certs/ca-bundle.crt".text = ''
    ${builtins.readFile (pkgs.cacert + "/etc/ca-bundle.crt")}
    ${builtins.readFile ./my-certificate.crt}
  '';

That failed too:

  building path(s) '/nix/store/.....-etc-file'
  while setting up the build environment: executing
'/nix/store/....-bash-4.3-p30/bin/bash': Argument list too long
  [exit error]

What to do now?

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list