Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https.Agent support for proxy server #49139

Closed
robertpatrick opened this issue Aug 13, 2023 · 1 comment
Closed

https.Agent support for proxy server #49139

robertpatrick opened this issue Aug 13, 2023 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.

Comments

@robertpatrick
Copy link

robertpatrick commented Aug 13, 2023

What is the problem this feature will solve?

I am trying to write a Nuxt3 application where the nitro server routes need to make Rest calls to a Kubernetes API Server in an environment where my company's network requires the use of an HTTP proxy server to reach the Kubernetes cluster.

When not on the corporate network, I am able to use code that looks like this:

import { Agent } from 'https';
...
const httpsAgent = new Agent({ ca: caCert });
const res = await axios.get(`${ adminClusterBaseUrl }/version`, {
    httpsAgent,
    headers: {
        Authorization: `Bearer ${ token }`,
        Cookie:        getHeader(event, 'cookie'),
    },
});
return res.data;

However, when on the corporate network, I need to switch to using the https-proxy-agent to get proxy server support but unfortunately, it does not appear to support passing the CA certificate data through so the request is failing on a TLS handshake error. I would like to be able to use the built-in https.Agent both with and without an HTTP proxy server.

What is the feature you are proposing to solve the problem?

The need to use a third-party package like https-proxy-agent to get support for a proxy server.

What alternatives have you considered?

I tried passing the CA certificate option to the HttpsProxyServer constructor but it does not seem to be honoring it. See TooTallNate/proxy-agents#234.

@robertpatrick robertpatrick added the feature request Issues that request new features to be added to Node.js. label Aug 13, 2023
@bnoordhuis
Copy link
Member

This is a duplicate of an earlier feature request that I can't find anymore because searching for "http proxy" turns up way too many results...

...but at any rate, last time around there was a) no consensus that proxy support isn't a giant slippery slope, and b) no one was stepping up to do the work.

I'm personally mildly in favor but I'm also cognizant of the slippery slope angle. If you want to open a pull request, go ahead, but keep in mind it might be massively more complicated than you initially expect - even more so for http/2.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@bnoordhuis bnoordhuis added duplicate Issues and PRs that are duplicates of other issues or PRs. http Issues or PRs related to the http subsystem. labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants