2 system ? builtins.currentSystem,
4 pkgs ? import ../.. { inherit system config; },
7 with import ../lib/testing-python.nix { inherit system pkgs; };
11 192.168.2.101 acme.test
16 builtins.listToAttrs (
19 name = pkgs.lib.getName nginxPackage;
21 name = "nginx-http3-${pkgs.lib.getName nginxPackage}";
22 meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
32 address = "192.168.2.101";
38 firewall.allowedTCPPorts = [ 443 ];
39 firewall.allowedUDPPorts = [ 443 ];
42 security.pki.certificates = [
43 (builtins.readFile ./common/acme/server/ca.cert.pem)
48 package = nginxPackage;
50 virtualHosts."acme.test" = {
52 sslCertificate = ./common/acme/server/acme.test.cert.pem;
53 sslCertificateKey = ./common/acme/server/acme.test.key.pem;
60 pkgs.runCommandLocal "testdir" { } ''
62 cat > "$out/index.html" <<EOF
63 <html><body>Hello World!</body></html>
65 cat > "$out/example.txt" <<EOF
77 environment.systemPackages = [ pkgs.curlHTTP3 ];
82 address = "192.168.2.201";
90 security.pki.certificates = [
91 (builtins.readFile ./common/acme/server/ca.cert.pem)
99 server.wait_for_unit("nginx")
100 server.wait_for_open_port(443)
102 # Check http connections
103 client.succeed("curl --verbose --http3-only https://acme.test | grep 'Hello World!'")
106 client.succeed("curl --verbose --http3-only https://acme.test/example.txt --output /tmp/example.txt")
107 client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
109 # Check header reading
110 client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'content-type'")
111 client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'HTTP/3 200'")
112 client.succeed("curl --verbose --http3-only --head https://acme.test/error | grep 'HTTP/3 404'")
114 # Check change User-Agent
115 client.succeed("curl --verbose --http3-only --user-agent 'Curl test 3.0' https://acme.test")
116 server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")