Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

misc: added timeout for est connection

Sheen Capadngan58838c541fcf
diff --git a/backend/src/server/routes/est/certificate-est-router.ts b/backend/src/server/routes/est/certificate-est-router.ts
index 1eec348ce4..7f401216e4 100644
--- a/backend/src/server/routes/est/certificate-est-router.ts
+++ b/backend/src/server/routes/est/certificate-est-router.ts
@@ -42,6 +42,11 @@ export const registerCertificateEstRouter = async (server: FastifyZodProvider) =
await res.hijack();
+ // definitive connection timeout to clean-up open connections and prevent memory leak
+ res.raw.setTimeout(10 * 1000, () => {
+ res.raw.end();
+ });
+
res.raw.setHeader(wwwAuthenticateHeader, `Basic realm="infisical"`);
res.raw.setHeader("Content-Length", 0);
res.raw.statusCode = 401;