Skip to content

Conversation

emilioalvap
Copy link
Contributor

@emilioalvap emilioalvap commented Jul 12, 2025

Summary

Add global proxy to push/locations command with:

  • Proxy settings based on env: HTTP_PROXY, HTTPS_PROXY, NO_PROXY.
  • Cli args to define custom proxy properties:
    • --proxy-uri:
    • --proxy-token: Based in auth header format, eg Basic Asaaas==
    • --proxy-ca: Custom CA chain file or string for self-signed certificate validation. Based on nodejs TLS secure context.
    • --proxy-cert: Custom cert chain file or string for self-signed certificate validation. Based on nodejs TLS secure context
    • --proxy-no-verify: Disable proxy TLS verification.

@emilioalvap emilioalvap changed the title Synthetics cli proxy support feat(proxy): synthetics cli proxy support Jul 12, 2025
@emilioalvap
Copy link
Contributor Author

Working on unit test rn

@emilioalvap
Copy link
Contributor Author

@mcapell @vigneshshanmugam This is ready for review

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good.

src/options.ts Outdated
try {
return readFileSync(filePath);
} catch (e) {
throw new Error(`could not be read provided path ${filePath}: ${e}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we keep the error specific to proxy settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the flag the error applies to, this is generic to any file-based option so I don't think it makes sense to restrict this only to proxy settings?

@emilioalvap emilioalvap self-assigned this Aug 7, 2025
mcapell
mcapell previously approved these changes Aug 8, 2025
Copy link
Contributor

@mcapell mcapell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it locally and it works

@mofakhar
Copy link

mofakhar commented Sep 12, 2025

Hi Team,
I'm struggling to get @elastic/synthetics behind our corporate proxy working as its keeps trying to resolve the target Kibana which is available only via the proxy.
I've tried multiples options to bypass this limitation but for now I'm stuck. Any help is really welcomed
When do you think this fix will be merged?

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with few nits

)
.option(
'--proxy-no-verify',
'disable TLS verification for the proxy connection',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does overriding NODE_TLS_UNAUTHORIZED disable this? can you callout this in the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioning NODE_TLS_REJECT_UNAUTHORIZED in our docs, as a featured that is strongly discouraged in nodejs docs, seems to me like would have the opposite effect and it's also inconsistent, we don't include it in our docs for Kibana TLS verification. It's not really overriding anything either, both are on by default. I'm inclined to merge it as it is and we can extend the docs if we get any corner case

Copy link
Contributor

@mcapell mcapell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@emilioalvap emilioalvap merged commit 2b70610 into main Oct 3, 2025
8 checks passed
@mofakhar
Copy link

mofakhar commented Oct 6, 2025

I've tested with version 1.19.0 and seems the new code in the main is not tagged yet!!! Can someone take a look into this please?

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

Successfully merging this pull request may close these issues.

Enteprise readiness - Support for HTTP_PROXY / HTTPS_PROXY / NO_PROXY or explicit proxy flag for the push command
5 participants