1 { system ? builtins.currentSystem,
3 pkgs ? import ../.. { inherit system config; }
6 with import ../lib/testing-python.nix { inherit system pkgs; };
10 192.168.2.101 acme.test
15 builtins.listToAttrs (
19 name = pkgs.lib.getName nginxPackage;
21 name = "nginx-http3-${pkgs.lib.getName nginxPackage}";
22 meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
25 server = { lib, pkgs, ... }: {
29 { address = "192.168.2.101"; prefixLength = 24; }
33 firewall.allowedTCPPorts = [ 443 ];
34 firewall.allowedUDPPorts = [ 443 ];
37 security.pki.certificates = [
38 (builtins.readFile ./common/acme/server/ca.cert.pem)
43 package = nginxPackage;
45 virtualHosts."acme.test" = {
47 sslCertificate = ./common/acme/server/acme.test.cert.pem;
48 sslCertificateKey = ./common/acme/server/acme.test.key.pem;
54 root = lib.mkForce (pkgs.runCommandLocal "testdir" {} ''
56 cat > "$out/index.html" <<EOF
57 <html><body>Hello World!</body></html>
59 cat > "$out/example.txt" <<EOF
67 client = { pkgs, ... }: {
68 environment.systemPackages = [ pkgs.curlHTTP3 ];
72 { address = "192.168.2.201"; prefixLength = 24; }
78 security.pki.certificates = [
79 (builtins.readFile ./common/acme/server/ca.cert.pem)
87 server.wait_for_unit("nginx")
88 server.wait_for_open_port(443)
90 # Check http connections
91 client.succeed("curl --verbose --http3-only https://acme.test | grep 'Hello World!'")
94 client.succeed("curl --verbose --http3-only https://acme.test/example.txt --output /tmp/example.txt")
95 client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
97 # Check header reading
98 client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'content-type'")
99 client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'HTTP/3 200'")
100 client.succeed("curl --verbose --http3-only --head https://acme.test/error | grep 'HTTP/3 404'")
102 # Check change User-Agent
103 client.succeed("curl --verbose --http3-only --user-agent 'Curl test 3.0' https://acme.test")
104 server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")
112 [ pkgs.angieQuic pkgs.nginxQuic ]