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

corporate proxy functionality #204

Closed
nmccready opened this issue Sep 15, 2023 · 14 comments
Closed

corporate proxy functionality #204

nmccready opened this issue Sep 15, 2023 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@nmccready
Copy link

What version?

No response

Which command?

No response

What happened?

All http/s calls are blocked.

$ proto install go 1.20
Error: plugin::http

  × Failed to make HTTP request.
  ├─▶ error sending request for url (https://github.com/moonrepo/go-plugin/releases/latest/download/go_plugin.wasm): error trying to connect: invalid peer certificate: UnknownIssuer

Any logs?

No response

Operating system?

MacOS

Architecture?

x64

@nmccready nmccready added the bug Something isn't working label Sep 15, 2023
@nmccready
Copy link
Author

Please refer to this thread TY oven-sh/bun#3917 (comment)

@milesj
Copy link
Contributor

milesj commented Sep 15, 2023

@nmccready Hrmm, is github overall blocked by your proxy? Does your company have custom certs that should be used (can maybe add a setting for this)?

I've never solved this kind of thing, but I'll look into it.

@milesj
Copy link
Contributor

milesj commented Sep 15, 2023

Tinkering here: #205

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

Added [http] in 0.18. Let me know if this works for you. I'll leave this open for now.

@nmccready
Copy link
Author

@nmccready Hrmm, is github overall blocked by your proxy? Does your company have custom certs that should be used (can maybe add a setting for this)?

I've never solved this kind of thing, but I'll look into it.

No its not blocked, thanks for looking.

Added [http] in 0.18. Let me know if this works for you. I'll leave this open for now.

Will try to verify today.

@nmccready
Copy link
Author

Something is still wonky

$ proto list-remote go
Error: plugin::http

  × Failed to make HTTP request.
  ├─▶ error sending request for url (https://github.com/moonrepo/go-plugin/releases/latest/download/
  │   go_plugin.wasm): error trying to connect: invalid peer certificate: UnknownIssuer
  ├─▶ error trying to connect: invalid peer certificate: UnknownIssuer
  ╰─▶ invalid peer certificate: UnknownIssuer


in ~
$ proto install go 1.19
Error: plugin::http

  × Failed to make HTTP request.
  ├─▶ error sending request for url (https://github.com/moonrepo/go-plugin/releases/latest/download/
  │   go_plugin.wasm): error trying to connect: invalid peer certificate: UnknownIssuer
  ├─▶ error trying to connect: invalid peer certificate: UnknownIssuer
  ╰─▶ invalid peer certificate: UnknownIssuer

Is there additional config needed for proto to pick up HTTP_PROXY, HTTPS_PROXY, http_proxy, and https_proxy?

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

What settings did you try? And can you include the --log trace output?

@nmccready
Copy link
Author

Nothing fancy, HTTP(S?)_PROXY is exported in the shell session as well as the lower case version. Normally this is picked up by whatever proxy agent.

$ proto --log trace list-remote  go
[DEBUG 2023-09-18 14:18:51] proto  Running proto v0.18.0
[TRACE 14:18:51] starbase::app  Running startup phase with 1 systems
[TRACE 14:18:51] starbase::app  Running analyze phase with 1 systems
[TRACE 14:18:51] starbase::app  Running execute phase with 2 systems
[DEBUG 14:18:51] proto_core::tool_loader:list_remote  Traversing upwards to find a configured plugin  tool="go"
[TRACE 14:18:51] warpgate::loader:list_remote  Creating plugin loader  cache_dir="/Users/SOME_USER/.proto/plugins"
[TRACE 14:18:51] warpgate::loader:list_remote  Loading plugin go  plugin="go" locator="source:https://github.com/moonrepo/go-plugin/releases/latest/download/go_plugin.wasm"
[TRACE 14:18:51] warpgate::loader:list_remote  Plugin not cached, downloading  plugin="go"
[TRACE 14:18:51] warpgate::loader:list_remote  Downloading plugin from URL  plugin="go" from="https://github.com/moonrepo/go-plugin/releases/latest/download/go_plugin.wasm" to="/Users/SOME_USER/.proto/plugins/go-latest-ad1b059006b052b961a3af8e2f33b4c7fc2eabdb9f4fac3dbb6c6093b60405cb.wasm"
[TRACE 14:18:51] starbase::app  Running shutdown phase with 1 systems
Error: plugin::http

  × Failed to make HTTP request.
  ├─▶ error sending request for url (https://github.com/moonrepo/go-plugin/releases/latest/download/
  │   go_plugin.wasm): error trying to connect: invalid peer certificate: UnknownIssuer
  ├─▶ error trying to connect: invalid peer certificate: UnknownIssuer
  ╰─▶ invalid peer certificate: UnknownIssuer

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

According to the docs, the env vars should work (https://docs.rs/reqwest/0.11.20/reqwest/#proxies), so maybe something else is going on?

I can probably be explicit and do the implementation manually instead of relying on the lib.

@nmccready
Copy link
Author

Seems similar. rustic-rs/rustic#679

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

Looks to be exactly the same, let me try that.

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

Ok, give 0.18.1 a shot.

@nmccready
Copy link
Author

Works 🎆

@milesj
Copy link
Contributor

milesj commented Sep 18, 2023

Ahh hell yeah. Thanks for finding that thread!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants