Зафиксировать проверку чистого клона и имени TLS

This commit is contained in:
2026-11-06 18:33:38 +03:00
parent 8f82949094
commit 5b28e7d130
5 changed files with 19 additions and 2 deletions
+11
View File
@@ -286,6 +286,16 @@ def isolated(mode, mounts):
return json.loads(raw)
def verify_hostname():
with socket.create_connection(("127.0.0.1", 8443), timeout=3) as raw:
try:
with context(CA).wrap_socket(raw, server_hostname="wrong-name.invalid"):
raise AssertionError("Wrong TLS hostname accepted")
except ssl.SSLCertVerificationError as exc:
assert exc.verify_code == 62, "Expected a hostname mismatch"
return "wrong_hostname_rejected"
def check_api(client):
alice, bob, eve, chat = client.bootstrap()
attachment, _ = client.attachment(alice, chat)
@@ -454,6 +464,7 @@ def main():
"tls": isolated("tls", {**identities, "rogue": rogue}),
"worker_scope": worker_probe(),
"api": check_api(client),
"external_hostname": verify_hostname(),
}
print("PASS: verified TLS and distinct service privileges", flush=True)
if args.rotate: