Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def test_curl_qualification_uses_fixed_hardened_argv() -> None:
assert argv[:2] == ["/usr/bin/curl", "--disable"]
assert argv[argv.index("--proto") : argv.index("--proto") + 2] == ["--proto", "=https"]
assert argv[argv.index("--proto-redir") : argv.index("--proto-redir") + 2] == ["--proto-redir", "=https"]
assert [arg for arg in argv if arg.startswith("--http")] == ["--http1.1"]
assert "--insecure" not in argv
assert "--location-trusted" not in argv
assert "--retry-all-errors" not in argv
Expand Down Expand Up @@ -859,6 +860,9 @@ def _https_fixture(tmp_path: Path) -> tuple[ThreadingHTTPServer, Path]:
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.minimum_version = ssl.TLSVersion.TLSv1_2
context.load_cert_chain(cert_path, key_path)
# Offer HTTP/2 first, as most download hosts do (#1475). http.server speaks only HTTP/1.x, so a client that
# accepted h2 would fail every transfer here.
context.set_alpn_protocols(["h2", "http/1.1"])
server.socket = context.wrap_socket(server.socket, server_side=True)
threading.Thread(target=server.serve_forever, daemon=True).start()
return server, cert_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
},
{
"path": "tools/maintained_client_acquisition.py",
"digest": "sha256:b8a538c975f054216cb54cb3f68163aa5dab642bc368a94db5d343732a67101a"
"digest": "sha256:0529ca32a87d33aeca570d659dec8d12d7f3227d38726077a39f344f7cbf2dc0"
},
{
"path": "tools/tooling_installed_tree.py",
Expand Down
3 changes: 3 additions & 0 deletions tools/maintained_client_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def curl_transfer_argv(
"=https",
"--proto-redir",
"=https",
# Qualification covers HTTP/1.1. Over HTTP/2, macOS curl 8.7.1 exits 56 for a size
# breach and does not retry a 503 (#1475).
"--http1.1",
"--max-redirs",
"5",
"--retry",
Expand Down
Loading