The TLS Interceptor (src/main/services/proxy/tls-interceptor.ts) provides per-session TLS interception for the Latch Enclave proxy. It generates:
Ephemeral CA — A self-signed RSA 2048 CA certificate created when a session starts. The CA cert is written to a temp file and injected into the sandbox via NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, and GIT_SSL_CAINFO.
Per-domain leaf certs — On-demand certificates for each domain the proxy intercepts, signed by the ephemeral CA. Cached per-domain for the session lifetime.
Key API
new TlsInterceptor() — Generates CA on construction
getCaCertPath() — Temp file path for env injection
getSecureContext(domain) — Returns Node.js tls.SecureContext for TLS server socket
destroy() — Wipes all keys and deletes temp files
Architecture
Uses node-forge for X.509 cert generation (pure JS, no native deps)
CA key stored in memory only, never on disk
Leaf certs cached per-domain (RSA keygen is expensive)
Entire lifecycle tied to session — construct on start, destroy on end
Testing
Run: npx vitest run src/main/services/proxy/tls-interceptor.test.ts
1---2name: enclave-tls-interceptor3description: Enclave TLS Interceptor4---5# Enclave TLS Interceptor67## What This Module Does89The TLS Interceptor (`src/main/services/proxy/tls-interceptor.ts`) provides per-session TLS interception for the Latch Enclave proxy. It generates:10111. **Ephemeral CA** — A self-signed RSA 2048 CA certificate created when a session starts. The CA cert is written to a temp file and injected into the sandbox via `NODE_EXTRA_CA_CERTS`, `SSL_CERT_FILE`, and `GIT_SSL_CAINFO`.12132. **Per-domain leaf certs** — On-demand certificates for each domain the proxy intercepts, signed by the ephemeral CA. Cached per-domain for the session lifetime.1415## Key API1617- `new TlsInterceptor()` — Generates CA on construction18- `getCaCertPath()` — Temp file path for env injection19- `getCertForDomain(domain)` — Returns `{ cert, key }` PEM pair20- `getSecureContext(domain)` — Returns Node.js `tls.SecureContext` for TLS server socket21- `destroy()` — Wipes all keys and deletes temp files2223## Architecture2425- Uses `node-forge` for X.509 cert generation (pure JS, no native deps)26- CA key stored in memory only, never on disk27- Leaf certs cached per-domain (RSA keygen is expensive)28- Entire lifecycle tied to session — construct on start, destroy on end2930## Testing3132Run: `npx vitest run src/main/services/proxy/tls-interceptor.test.ts`
Run npx skillmds@latest add latchagent/enclave-tls-interceptor in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Enclave TLS Interceptor It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
latchagent (@latchagent) published this skill. Their other Agent Skills are listed on their SkillMD profile.