-
Notifications
You must be signed in to change notification settings - Fork 150
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
Using Apache HttpComponents does not honor the JVM Proxy settings #75
Comments
It seems strange to me to connect to vault, the thing that stores secrets, via a proxy. Why exactly would you require it? |
Well, I cannot connect to vault, running on AWS, from my workplace behind the firewall. The proxy does not intercept SSL, so the connection is still secured end to end. |
Proxy support depends on the used HTTP client. Spring Vault supports Apache HttpComponents, OkHttp 2+3, Netty and the JDK client (in that order of dependencies available during runtime). You can provide an own |
@spencergibb No, not for development. We have internal applications that need to access secrets on this vault, which is hosted outside of the corporate network, therefore we need to access it via the proxy. There is simply no other way to do that, and it works just fine with the command line client, Jenkins plugins, etc.; just not with Spring-cloud-vault. Thanks @mp911de, I will look into that solution. Still, as vault is an HTTP application, it should honor the proxy settings of the JVM per default. |
From a technical perspective, if there is no external HTTP client, the JDK HTTP client is used which takes proxy system properties into account. As soon as an external HTTP client is on the class path, the JDK HTTP client is no longer used. I think it would make sense to support HTTP proxy configuration because runtime environments can sometimes require a HTTP proxy. Any intercepting proxy is a threat for secrets and I assume that client certificate authentication stops working when using an intercepting proxy. We could provide proxy support for Apache HttpComponents, OkHttp 2 and 3 via system properties and configuration properties. |
In other spring cloud uses of Apache and okhttp we support system properties, but not configuration properties. |
Ok, let's stick to that which requires only a change to Spring Vault. I created spring-projects/spring-vault#52 to do the actual change. I'll close this ticket once the change is in place. |
Again, going over an HTTP proxy seems like a bad idea when you can use AWS VPN. |
That's fixed with spring-projects/spring-vault@d3af1d4. OkHttp 2 and 3 use the JVM proxy settings by default, only Apache HttpComponents was affected. |
Spring-cloud-vault does not respect the http.proxyHost and http.proxyPort system parameters when connecting to vault, it always tries to connect directly. This makes it unusable behind a proxy like in many corporate environments.
The text was updated successfully, but these errors were encountered: