-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement support for HTTP proxies to support corporate deployments #9
Comments
@jdegoes coursier is not tied to How do you handle those proxies from sbt? |
Thanks for reporting! The current solution for HTTP proxies is that users can update the "server properties" setting in VS Code to include If
If |
Any progress here? This issue is because coursier does not support proxy authentication? |
@SIkebe The proxy authentication is supported as far as I know, a number of additional properties need to be setup as explained above. There are some improvements that can be made in the area like:
There is some more information about the current state here: https://scalameta.org/metals/docs/build-tools/proxy.html We would be happy to help out however we can if there are still problems, however we do lack some information what exactly doesn't work currently and we do not have anyone able to spend time on the improvements. |
Actually, there are corporate machines that allows no connection to www. Would rather see just copying a cache or directory type of solution. And, I think I made this work to most part. |
Metals already provides a custom main method to pre-populate caches that you can launch with Coursier like this cs launch org.scalameta:metals_2.12:VERSION --main scala.meta.metals.DownloadDependencies Users with restricted network access can for example use this command to build a docker image that can run Metals offline. Note that this command only populates the Metals caches, you would need to additionally cache outputs from the build (for example install sbt-bloop and run |
I'm gonna close this issue as resolved since there exists now
Please open a separate issue if the existing options don't work for you. |
hi, https://scalameta.org/metals/docs/build-tools/proxy.html is broken now |
Is your feature request related to a problem? Please describe.
In corporate environments, the Coursier bootstrap script will fail, because the program will attempt to download the Coursier JAR without proxy settings, and there is no way to configure these.
The solution is not as simple as adding the deprecated
http.proxyHost
andhttp.proxyPort
properties (and their SSL variations), because many proxies act as their own CA, and neither this CA nor the certificates they certify will be added to the key store, if indeed a key store is accessible in the environment in which Coursier is running.Describe the solution you'd like
The ideal solution would be to fix Coursier deeply, so that it would use a real proxy (not rely on HttpURLConnection's flaky use of deprecated environment variables), and prompt user to accept certificates as necessary into a key store with write permissions, probably in the same place where metals is installed (as that's the only place you can guarantee has write access; the Java directory will be locked down in many corporate environments).
Describe alternatives you've considered
Metals could at least provide some configuration options for proxy information, which it would then forward to the bootstrap script (right now the JAR is started via the script, and there's no direct way to pass it options; one can try
JAVA_TOOL_OPTIONS
but it's unreliable and requires the ability to edit environment variables, which is disabled in many corporate environments). In particular, the fields should include http / https server and port, as well as username and password (many proxies require authentication), and whether or not to debug SSL connections; and the key store location.Additional context
NDAs prevent me from including logs or further details.
Search terms:
HTTPS SSL proxies corporate firewalls IT proxy authentication.
The text was updated successfully, but these errors were encountered: