(_protocol: string)
| 808 | // Return an HttpAgentFactory function that creates our proxy agent |
| 809 | const caCerts = getCACertificates() |
| 810 | const agentFactory = (_protocol: string) => { |
| 811 | // Create and return the proxy agent with mTLS and CA cert config |
| 812 | const proxyAgent = |
| 813 | mtlsConfig || caCerts |
| 814 | ? new HttpsProxyAgent(proxyUrl, { |
| 815 | ...(mtlsConfig && { |
| 816 | cert: mtlsConfig.cert, |
| 817 | key: mtlsConfig.key, |
| 818 | passphrase: mtlsConfig.passphrase, |
| 819 | }), |
| 820 | ...(caCerts && { ca: caCerts }), |
| 821 | }) |
| 822 | : new HttpsProxyAgent(proxyUrl) |
| 823 | |
| 824 | return proxyAgent |
| 825 | } |
| 826 | |
| 827 | config.httpAgentOptions = agentFactory |
| 828 | return config |
nothing calls this directly
no outgoing calls
no test coverage detected