Skip to content

Commit

Permalink
Add basic constraints to certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Mar 20, 2023
1 parent 7c576fb commit a77fbdc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/lib/certs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def make_tls_cert(hostname: str) -> Tuple[x509.Certificate, rsa.RSAPrivateKey]:
.serial_number(x509.random_serial_number())
.not_valid_before(datetime.utcnow())
.not_valid_after(datetime.utcnow() + timedelta(days=10))
.add_extension(
x509.BasicConstraints(ca=True, path_length=9),
critical=True,
)
.add_extension(
x509.SubjectAlternativeName([x509.DNSName(hostname)]),
critical=False,
Expand Down

0 comments on commit a77fbdc

Please sign in to comment.