TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

Need HttpsProxyAgent to support setting the CA Cert #234

Open robertpatrick opened 10 months ago

robertpatrick commented 10 months ago

I have existing code that uses https.Agent doing the following and it is working when not on my company network:

import { Agent } from 'https';

...

const agent = new Agent({ ca: caCert });

const config: AxiosRequestConfig = {
  httpsAgent: agent
  headers: {
    Authorization: `Bearer ${ token }`,
    Cookie:        getHeader(event, 'cookie'),
  },
};
const res = await axios.get(`${ adminClusterBaseUrl }/version`, config);

I tried swapping out https.Agent with HttpsProxyAgent and passing the proxy URL and the same options to the constructor but I am getting an error that seems to indicate that it is not honoring the ca attribute.

sibelius commented 5 months ago

is there a plan for this ?