Keep rotated credentials reproducible and verify expired allowed identity
This commit is contained in:
@@ -146,6 +146,7 @@ def test_expired_certificate_rejected(tcp_boundary, tmp_path):
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
assert exchange(tcp_boundary[0], client("lb")) == b"positive"
|
||||
cert = tmp_path / "expired.pem"
|
||||
subprocess.run(
|
||||
[
|
||||
@@ -153,7 +154,7 @@ def test_expired_certificate_rejected(tcp_boundary, tmp_path):
|
||||
"x509",
|
||||
"-req",
|
||||
"-in",
|
||||
str(ROOT / "operator-private/worker.csr"),
|
||||
str(ROOT / "operator-private/lb.csr"),
|
||||
"-CA",
|
||||
str(ROOT / "operator-private/ca.pem"),
|
||||
"-CAkey",
|
||||
@@ -163,7 +164,7 @@ def test_expired_certificate_rejected(tcp_boundary, tmp_path):
|
||||
"-days",
|
||||
"0",
|
||||
"-extfile",
|
||||
str(ROOT / "operator-private/worker.ext"),
|
||||
str(ROOT / "operator-private/lb.ext"),
|
||||
"-out",
|
||||
str(cert),
|
||||
],
|
||||
@@ -172,7 +173,7 @@ def test_expired_certificate_rejected(tcp_boundary, tmp_path):
|
||||
)
|
||||
time.sleep(1)
|
||||
ctx = client()
|
||||
ctx.load_cert_chain(cert, ROOT / "secrets/pki/worker/key.pem")
|
||||
ctx.load_cert_chain(cert, ROOT / "secrets/pki/lb/key.pem")
|
||||
try:
|
||||
result = exchange(tcp_boundary[0], ctx)
|
||||
except (OSError, ssl.SSLError):
|
||||
|
||||
Reference in New Issue
Block a user