Зафиксировать проверку чистого клона и имени TLS
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user