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

Obey https_proxy settings #764

Closed
mwisnicki opened this issue Aug 16, 2022 · 12 comments · Fixed by #765
Closed

Obey https_proxy settings #764

mwisnicki opened this issue Aug 16, 2022 · 12 comments · Fixed by #765
Assignees
Labels
bug Something isn't working

Comments

@mwisnicki
Copy link

I have http_proxy and https_proxy set yet the extension is most likely failing to use them.

Please provide better behaviour than jvm defaults which are horrible.

See #134 for details.

@angelozerr
Copy link
Contributor

@mwisnicki
Copy link
Author

My http.proxySupport was already set to override. VSCode has not trouble using the proxy.
Problem seems specific to vscode-xml.

I want things to work out of the box whenever reasonable.

@mwisnicki
Copy link
Author

Although I also tried JVM args (http.proxyHost etc) through xml.server.binary.args as well as JAVA_TOOL_OPTIONS and neither seems to work ("Connection refused") even though the latter is being logged in extension log file so perhaps the problem lies elsewhere.

@angelozerr
Copy link
Contributor

@datho7561 have you some idea?

@datho7561
Copy link
Contributor

@mwisnicki have you tried following these instructions: https://github.com/redhat-developer/vscode-xml/blob/main/docs/Preferences.md#setting-up-proxy ? Make sure you set both the HTTP and HTTPS proxies.

The extension should use the VS Code proxy settings to download schemas. Unfortunately, there was a bug in the implementation, and this was only being configured for HTTP and not HTTPS (see #735). I made a fix for this a while ago, but we haven't released a new version of the extension since then. If you are able to, try enabling the preview version of the extension and see if that fixes it.

If there is some other issue beyond this, please let me know.

@angelozerr I think we should do a release soon to address this, what do you think?

@mwisnicki
Copy link
Author

Yes I have the proxy setup.

Switched to pre-release. Still failing in CacheResourcesManager lambda$downloadResource$0()
With http url I'm getting [java.io.FileNotFoundException] http://maven.apache.org/xsd/maven-4.0.0.xsd
while with https it's [java.net.ConnectException] Connection refused: connect.

@datho7561
Copy link
Contributor

Okay. Are you using any sort of Authorization with the proxy? I have only tried with Basic authorization and without any authorization.

@mwisnicki
Copy link
Author

Doh, I had a typo in proxyPort!
So both work if I set JVM flags and pre-release version even follows redirects.

However neither obeys vscode proxy settings and http.proxySupport=override so this bug still stands.

@mwisnicki
Copy link
Author

Not using authorization directly. Have cntlm and

http_proxy=http://localhost:3128
https_proxy=$http_proxy

@datho7561
Copy link
Contributor

Okay, thanks for your help. Just to confirm I understand correctly, you set up the proxy in VS Code using environment variables? We have code in place to read the VS Code setting http.proxy, but not to use the http_proxy/https_proxy environment variables, so I'll take a look into implementing this.

@datho7561 datho7561 added the bug Something isn't working label Aug 17, 2022
@datho7561 datho7561 self-assigned this Aug 17, 2022
datho7561 added a commit to datho7561/vscode-xml that referenced this issue Aug 17, 2022
Reads the environment variable `http_proxy` as the proxy config if the
setting `"http.proxy"` is not set.

Closes redhat-developer#764

Signed-off-by: David Thompson <davthomp@redhat.com>
@mwisnicki
Copy link
Author

Okay, thanks for your help. Just to confirm I understand correctly, you set up the proxy in VS Code using environment variables? We have code in place to read the VS Code setting http.proxy, but not to use the http_proxy/https_proxy environment variables, so I'll take a look into implementing this.

Yes. Thanks for looking into this. IMHO it should be on VS Code to provide single consistent way of obtaining proxy by extensions.

@datho7561
Copy link
Contributor

Looks like the nightly build for the prerelease went through. If you have time, please let me know if this fixed your issue

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

Successfully merging a pull request may close this issue.

3 participants