This commit is contained in:
Fang-Pen Lin
2025-10-31 17:49:32 -07:00
parent d80a5414a5
commit b410d886ba
2 changed files with 4 additions and 5 deletions

View File

@@ -350,15 +350,14 @@ def step_impl(context: Context, var_path: str, hostname: str):
if hostname != "localhost":
raise ValueError("Currently only localhost is supported")
challenge = eval_var(context, var_path, as_json=False)
acme_challenge = challenge.chall
response, validation = acme_challenge.response_and_validation(
response, validation = challenge.response_and_validation(
context.acme_client.net.key
)
resource = standalone.HTTP01RequestHandler.HTTP01Resource(
chall=acme_challenge, response=response, validation=validation
chall=challenge, response=response, validation=validation
)
# TODO: make port configurable
servers = standalone.HTTP01DualNetworkedServers(("", 8087), resource)
servers = standalone.HTTP01DualNetworkedServers(("0.0.0.0", 8087), resource)
# Start client standalone web server.
web_server = threading.Thread(name="web_server", target=servers.serve_forever)
web_server.daemon = True

View File

@@ -413,7 +413,7 @@ export const pkiAcmeServiceFactory = ({
// RFC 8555 suggests a token with at least 128 bits of entropy
// We are using 256 bits of entropy here, should be enough for now
// ref: https://datatracker.ietf.org/doc/html/rfc8555#section-11.3
token: crypto.randomBytes(32).toString("base64"),
token: crypto.randomBytes(32).toString("base64url"),
// TODO: read config from the profile to get the expiration time instead
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000)
},