1 # Minica can provide a CA key and cert, plus a key
2 # and cert for our fake CA server's Web Front End (WFE).
4 pkgs ? import <nixpkgs> {},
6 runCommandCC ? pkgs.runCommandCC,
9 conf = import ./snakeoil-certs.nix;
11 domainSanitized = pkgs.lib.replaceStrings ["*"] ["_"] domain;
13 runCommandCC "generate-tests-certs" {
14 buildInputs = [ (minica.overrideAttrs (old: {
16 sed -i 's_NotAfter: time.Now().AddDate(2, 0, 30),_NotAfter: time.Now().AddDate(20, 0, 0),_' main.go
23 --ca-cert ca.cert.pem \
28 mv ${domainSanitized}/key.pem $out/${domainSanitized}.key.pem
29 mv ${domainSanitized}/cert.pem $out/${domainSanitized}.cert.pem