Pass --days to build-client-full when a lifetime is set

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Vlad Doloman
2026-08-15 05:16:41 +03:00
parent 119a567a49
commit 2e98155b5f
2 changed files with 53 additions and 2 deletions

View File

@@ -352,12 +352,16 @@ def revoke_issued(
def build_client_full(
easyrsa_dir: str, pki_dir: str, cn: str,
key_passphrase: str, ca_passphrase: str, email: str = "",
key_passphrase: str, ca_passphrase: str, email: str = "", days: str = "",
) -> None:
extra_env = {"EASYRSA_REQ_EMAIL": email} if email else None
_run_easyrsa(
_base_cmd(easyrsa_dir, pki_dir, ca_passphrase)
+ [f"--passout=pass:{key_passphrase}", "build-client-full", cn],
+ [f"--passout=pass:{key_passphrase}"]
# Global option, so it must precede the verb. Deliberately not in
# _base_cmd(): gen-crl reads --days as CRL validity instead.
+ ([f"--days={days}"] if days else [])
+ ["build-client-full", cn],
cwd=easyrsa_dir,
extra_env=extra_env,
)