Hello,
I'm investigating the possibility of implementing support for HTTP_PROXY, HTTPS_PROXY and NO_PROXY env vars. The main motivation is
KEYCLOAK-19080 but since the variables are not limited only to OpenShift or cloud environment in general, I'm considering implementing it directly in the ConnectionsHttpClient SPI. Currently it is possible to configure proxy mappings
only through standalone.xml. My thoughts were something like this:
if (proxy mappings not specified in standalone.xml) {
if (HTTPS_PROXY != null) {
route all traffic through HTTPS_PROXY
}
else if (HTTP_PROXY != null) {
route all traffic through HTTP_PROXY
}
if (NO_PROXY != null) {
define exceptions that won't use proxy
}
}
else {
route traffic as configured in standalone.xml
}
The only risk is that it is not backward compatible. Let's say that somebody doesn't use a proxy (doesn't have it configured in standalone.xml) but has HTTP_PROXY env var set on his system. Then Keycloak would unexpectedly start using a proxy. On the other hand, if empty proxy mapping would be specified in standalone.xml, Keycloak wouldn't effectively use any proxy (regardless the env vars). This behaviour would be of course documented.
WDYT?
Thanks!
--
Václav Muzikář
Senior Software Engineer
Keycloak / Red Hat Single Sign-On
Red Hat Czech s.r.o.