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

Unable to add https_proxy in wreck client #302

Open
Praveen2099 opened this issue May 15, 2023 · 0 comments
Open

Unable to add https_proxy in wreck client #302

Praveen2099 opened this issue May 15, 2023 · 0 comments
Labels
support Questions, discussions, and general support

Comments

@Praveen2099
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no):
  • is this issue affecting a production system? (yes/no):

Context

  • node version: 10.24.1
  • module version with issue: 15.0.2
  • last module version without issue:
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): Opensearch dashboard security plugin
  • any other relevant information:
  • module name hapi/wreck client

What are you trying to achieve or the steps to reproduce?

My application is deployed in virtual private network.So now i want to use it externally and it required to call a third party external internet URL.So I want to pass a proxy server so wreck client can connect that url .

I have used kubernetes http_proxy environment variables but wreck client not respect it.

private createWreckClient(): typeof wreck {

    const wreckHttpsOption: WreckHttpsOptions = {};
    if (this.config.openid?.root_ca) {
      wreckHttpsOption.ca = [fs.readFileSync(this.config.openid.root_ca)];
    }
    if (this.config.openid?.verify_hostnames === false) {
      this.logger.debug(`openId auth 'verify_hostnames' option is off.`);
      wreckHttpsOption.checkServerIdentity = (host: string, cert: PeerCertificate) => {
        return undefined;
      };
    }
    if (Object.keys(wreckHttpsOption).length > 0) {
      return wreck.defaults({
        agents: {
          http: new HTTP.Agent(),
          https: new HTTPS.Agent(wreckHttpsOption),
          httpsAllowUnauthorized: new HTTPS.Agent({
            rejectUnauthorized: false,
          }),
        },
      });
    } else {
      return wreck;
    }
  }

What was the result you got?

{"type":"log","@timestamp":"2023-05-15T11:03:56Z","tags":["error","plugins","securityDashboards"],"pid":1,"message":"{ Error: connect ETIMEDOUT 240:f6e4:e6b2:4838:0ff0:158b:3654:8065:443\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)\n errno: 'ETIMEDOUT',\n code: 'ETIMEDOUT',\n syscall: 'connect',\n address: '240:f6e4:e6b2:4838:0ff0:158b:3654:8065',\n port: 443,\n trace:\n [ { method: 'GET',\n url:\n 'https://somedns/.well-known/openid-configuration' } ],\n isBoom: true,\n isServer: true,\n data: null,\n output:\n { statusCode: 502,\n payload:\n { message:\n 'Client request error: connect ETIMEDOUT 240:f6e4:e6b2:4838:0ff0:158b:3654:8065:443',\n statusCode: 502,\n error: 'Bad Gateway' },\n headers: {} } }"}
{"type":"log","@timestamp":"2023-05-15T11:03:56Z","tags":["warning","environment"],"pid":1,"message":"Detected an unhandled Promise rejection.\nError: Failed when trying to obtain the endpoints from your IdP"}

What result did you expect?

External url should be accessible with proxy

@Praveen2099 Praveen2099 added the support Questions, discussions, and general support label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

1 participant