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

Add option to ignore all proxies #1947

Closed
jakegt1 opened this issue May 14, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1799
Closed

Add option to ignore all proxies #1947

jakegt1 opened this issue May 14, 2021 · 4 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1799
Assignees
Milestone

Comments

@jakegt1
Copy link

jakegt1 commented May 14, 2021

I cannot get environment variable set proxies to not apply to vscode java in any way. I do not want to set a proxy, so it would be nice to have an option to force it to ignore all system proxies.

Environment
  • Operating System: CentOS 7
  • JDK version: 11
  • Visual Studio Code version: 1.56.2
  • Java extension version: 0.79.1
Steps To Reproduce
  1. Set http_proxy in bashrc
  2. Vscode java doesn't work because it tries to route through the proxy
Current Result

!ENTRY org.eclipse.buildship.core 2 3 2021-05-14 15:16:23.920
!MESSAGE Synchronize project $SOME_PROJECT failed due to an error connecting to the Gradle build.
!STACK 0
org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from '$INTERNAL_URL/gradle/7.0.2-bin/gradle-7.0.2-bin.zip'.

Expected Result

Add feature to ignore system proxies so as nothing i do with this plugin is external

Additional Informations

I've had forms of this problem for absolutely ages. I've tried to set a proxy using system properties, which doesn't seem to work. The only way i can get this to work is by changing bashrc to not set proxies at all, restarting vscode and then running the plugin.
If there was an option to force disabling of all proxies, that would be great as then i don't have to worry about trying to configure a proxy or having to deal with the proxy working anyway.

The other option would be to have the plugin respect the no_proxy environment variable which it does not seem to do.

@snjeza
Copy link
Contributor

snjeza commented May 20, 2021

@jakegt1 could you try to add the following setting:

"java.jdt.ls.vmargs": "-Dhttp.nonProxyHosts=* <your vmargs>",

@jakegt1
Copy link
Author

jakegt1 commented May 21, 2021

I have tried this, it does not work. Same error.

!ENTRY org.eclipse.core.net 1 0 2021-05-21 13:05:27.689
!MESSAGE System property http.nonProxyHosts has been set to * by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2021-05-21 13:05:27.694
!MESSAGE System property https.nonProxyHosts has been set to * by an external source. This value will be overwritten using the values from the preferences

I have found a solution i think works though, but i'd like you to reproduce it if poss:

I created org.eclipse.core.net.prefs and copied this into $HOME/.vscode/data/User/workspaceStorage/$UUID/redhat.java/jdt_ws/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.net.prefs. After reloading the window, things resolved as normal and worked.

Example org.eclipse.core.net.prefs:

systemProxiesEnabled=false
proxiesEnabled=false
eclipse.preferences.version=1
nonProxiedHosts=*
org.eclipse.core.net.hasMigrated=true

@jakegt1
Copy link
Author

jakegt1 commented May 21, 2021

@snjeza hope that makes sense.

@jakegt1
Copy link
Author

jakegt1 commented Jun 8, 2021

Any update on this? The above fix isn't something I can really do every time as it will be reset if the workspace is cleaned up.

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 a pull request may close this issue.

3 participants