[go: nahoru, domu]

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

Impossible to specify an httpAgent when running on GCP infrastructure #1880

Open
brettwillis opened this issue Aug 19, 2022 · 1 comment
Open
Assignees

Comments

@brettwillis
Copy link

An HTTP agent can be specified in initializeApp() using AppOptions.httpAgent.

When running on GCP infrastructure using application default credentials, the SDK will request the internal metadata server at an http: address, see below:

private buildRequest(urlPath: string): HttpRequestConfig {
return {
method: 'GET',
url: `http://${GOOGLE_METADATA_SERVICE_HOST}${urlPath}`,
headers: {
'Metadata-Flavor': 'Google',
},
httpAgent: this.httpAgent,
};
}

And naturally, all other API requests during operation of the SDK use the https: protocol.

This means that it is impossible to provide a native NodeJS http.Agent or a https.Agent because it will always fail due to the mix of http: and https: requests it will be used for.

This should either be fixed (e.g. don't use the provided agent for the internal metadata server http: request) or documented.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants