Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Serve challenge server
Fang-Pen Lin3a05ad8cd18a
diff --git a/backend/bdd/features/pki/acme/challenge.feature b/backend/bdd/features/pki/acme/challenge.featureindex 0bf5681231..2079b9a576 100644--- a/backend/bdd/features/pki/acme/challenge.feature+++ b/backend/bdd/features/pki/acme/challenge.feature@@ -17,4 +17,5 @@ Feature: ChallengeThen I sign the certificate signing request csr with private key cert_key and output it as csr_pem in PEM formatThen I submit the certificate signing request PEM csr_pem certificate order to the ACME server as orderThen I select challenge with type http-01 for domain localhost from order at order as challenge+ Then I serve challenge response for challenge at localhostdiff --git a/backend/bdd/features/steps/pki_acme.py b/backend/bdd/features/steps/pki_acme.pyindex ca90c54157..f1219b801e 100644--- a/backend/bdd/features/steps/pki_acme.py+++ b/backend/bdd/features/steps/pki_acme.py@@ -6,6 +6,7 @@ import requestsimport glomfrom acme import clientfrom acme import messages+from acme import standalonefrom behave.runner import Contextfrom behave import givenfrom behave import when@@ -340,4 +341,21 @@ def step_impl(raise ValueError(f"More than one authorization for type {challenge_type!r} found in {var_path!r}")- context.vars[challenge_var] = auths[0]+ context.vars[challenge_var] = challenges[0]+++@then("I serve challenge response for {var_path} at {hostname}")+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(+ context.acme_client.net.key+ )+ resource = standalone.HTTP01RequestHandler.HTTP01Resource(+ chall=acme_challenge, response=response, validation=validation+ )+ servers = standalone.HTTP01DualNetworkedServers(("", 8087), resource)+ # Start client standalone web server.+ servers.serve_forever()