feat(http): add proxy support (#4721)

This commit is contained in:
Meier Lukas
2025-12-25 11:32:14 +01:00
committed by GitHub
parent 707a4dad83
commit 5a57115ca0
10 changed files with 52 additions and 30 deletions

View File

@@ -42,12 +42,13 @@ export const createCertificateAgentAsync = async (override?: {
};
export const createHttpsAgentAsync = async (override?: Pick<AgentOptions, "ca" | "checkServerIdentity">) => {
return new HttpsAgent(
override ?? {
ca: await getAllTrustedCertificatesAsync(),
checkServerIdentity: createCustomCheckServerIdentity(await getTrustedCertificateHostnamesAsync()),
},
);
return new HttpsAgent({
ca: await getAllTrustedCertificatesAsync(),
checkServerIdentity: createCustomCheckServerIdentity(await getTrustedCertificateHostnamesAsync()),
// Override the ca and checkServerIdentity if provided
...override,
proxyEnv: process.env,
});
};
export const createAxiosCertificateInstanceAsync = async (