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

Support and propagate HTTP options for proxy, ssl. #5429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mihailik
Copy link

@mihailik mihailik commented Feb 25, 2025

Command line parameters for proxy, ssl root, ssl opt-in for self-signed certificates

See issue for long rationale #5423 SSL/proxy flexibility for corporate environment

This PR introduces ClientBuilderConfig in lib/wasix/src/http/client_builder.rs and corresponding CliClientBuilderConfig at lib/cli/src/config/env.rs.

These are the config options:

  • proxy to specify HTTP proxy
  • ca_file to specify SSL root certificate override
  • unsafe_disable_ssl_verify to allow self-signed certificates

They are parsed from the command line, and passed around during runtime initialisation flow. When any HTTP request is made, ClientBuilderConfig::create_client_builder is the one producing ClientBuilder with necessary settings.

Every creation of reqwest::ClientBuilder anywhere in Wasmer codebase now goes through ClientBuilderConfig::create_builder.

Corporate environment case

SSL spoofing and seemingly insecure HTTP proxies are commonplace in large corporate environments. You just can't reach out to the big internet without a bit of customisation.

This PR allows that customisation from a command line, explicitly.

It also makes it easy to further tweaki the settings, should you need it. The options can be captured with clap:: annotations in CliClientBuilderConfig and the single central place for handling them is ClientBuilderConfig::create_client_builder.

Testing and coding style

I've updated the existing tests to account for the changes, and tried to adhere to the coding styles.

Any feedback, guidance, refactoring/naming suggestions are welcome! I'm not fussy about how this feature implemented, just really want to enable Wasmer for a possible corporate use.

Copy link

promptless bot commented Feb 25, 2025

📝 Documentation updates detected! A separate PR for documentation updates has been made here: wasmerio/docs.wasmer.io#117

@mihailik mihailik force-pushed the support-and-propagate-http-options branch 10 times, most recently from 9306537 to 45f8188 Compare March 3, 2025 20:06
@mihailik mihailik force-pushed the support-and-propagate-http-options branch from 45f8188 to fc87b19 Compare March 3, 2025 20:21
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.

1 participant