ca = pkgs.fetchurl
{
url = "https://calyx.net/ca.crt";
- hash = "sha256-NKLkpjjeGMN07htuWydBMQ03ytxF9CLm8SLNl3IPPGc=";
+ # WARNING: a change to that CA will likely not be detected
+ # because it being already in the Nix store,
+ # and cause the preStart to fail.
+ hash = "sha256-zLs7TRXrHlPjqdaBN1cmbB062XhKs4cv5ajmrkg4O8s=";
curlOptsList = [ "-k" ];
} + "";
key-cert = "/run/openvpn-${netns}/key+cert.pem";
services.openvpn.servers.${netns} = {
inherit netns;
settings = {
+ # See: https://gitlab.com/nitrohorse/bitmask-openvpn-generator
remote =
- # new-york
- [ "162.247.73.193" ] ++
+ # new-york (vpn2.calyx.net)
+ [ "162.247.72.193" ] ++
[ ];
remote-random = true;
port = "443";
cert = key-cert;
auth = "SHA1";
- cipher = "AES-128-CBC";
client = true;
dev = "ov-${netns}";
dev-type = "tun";
preStart = ''
(
set -ex
- ${pkgs.curl}/bin/curl -X POST --cacert ${ca} -o ${key-cert} -Ls ${apiUrl}
+ ${pkgs.curl}/bin/curl -X POST --cacert ${ca} -o ${key-cert} -vLs ${apiUrl}
chmod 700 ${key-cert}
)
'';