1 import ./make-test-python.nix ({lib, pkgs, ...}:
4 192.168.2.101 acme.test
10 meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
13 server = { pkgs, ... }: {
17 { address = "192.168.2.101"; prefixLength = 24; }
21 firewall.allowedTCPPorts = [ 443 ];
22 firewall.allowedUDPPorts = [ 443 ];
25 security.pki.certificates = [
26 (builtins.readFile ./common/acme/server/ca.cert.pem)
31 package = pkgs.nginxQuic;
33 virtualHosts."acme.test" = {
35 sslCertificate = ./common/acme/server/acme.test.cert.pem;
36 sslCertificateKey = ./common/acme/server/acme.test.key.pem;
40 root = lib.mkForce (pkgs.runCommandLocal "testdir2" {} ''
42 cat > "$out/index.html" <<EOF
43 <html><body>Hello World!</body></html>
45 cat > "$out/example.txt" <<EOF
53 client = { pkgs, ... }: {
54 environment.systemPackages = [ pkgs.curlHTTP3 ];
58 { address = "192.168.2.201"; prefixLength = 24; }
64 security.pki.certificates = [
65 (builtins.readFile ./common/acme/server/ca.cert.pem)
73 server.wait_for_unit("nginx")
74 server.wait_for_open_port(443)
76 # Check http connections
77 client.succeed("curl --verbose --http3 https://acme.test | grep 'Hello World!'")
80 client.succeed("curl --verbose --http3 https://acme.test/example.txt --output /tmp/example.txt")
81 client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
83 # Check header reading
84 client.succeed("curl --verbose --http3 --head https://acme.test | grep 'content-type'")
86 # Check change User-Agent
87 client.succeed("curl --verbose --http3 --user-agent 'Curl test 3.0' https://acme.test")
88 server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")