Fix TTL for issuing cert

This commit is contained in:
Fang-Pen Lin
2025-11-10 15:41:33 -08:00
parent 5a47ac3a9d
commit 7de071736e
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
import json
import logging
import os
import re
import threading
import urllib.parse
@@ -138,8 +137,8 @@ def step_impl(context: Context, faker_type: str, var_name: str):
@given('I have an ACME cert profile as "{profile_var}"')
def step_impl(context: Context, profile_var: str):
profile_id = os.getenv("PROFILE_ID")
secret = os.getenv("EAB_SECRET")
profile_id = context.vars.get("PROFILE_ID")
secret = context.vars.get("EAB_SECRET")
if profile_id is not None and secret is not None:
kid = profile_id
else:

View File

@@ -641,11 +641,12 @@ export const pkiAcmeServiceFactory = ({
notAfter: finalizingOrder.notAfter ? new Date(finalizingOrder.notAfter) : undefined,
validity: !finalizingOrder.notAfter
? {
// 47 days, the default TTL comes with Let's Encrypt
// TODO: read config from the profile to get the expiration time instead
ttl: (24 * 60 * 60 * 1000).toString()
ttl: `${47 * 24 * 60}m`
}
: // ttl is not used if notAfter is provided
({ ttl: "0" } as const),
({ ttl: "0m" } as const),
enrollmentType: EnrollmentType.ACME
});
// TODO: associate the certificate with the order