A customer is accessing an HttpServer backend via HttpURLConnection through JAX-WS. Connections get authenticated by some special mechanism on a per-socket base and subsequent HTTP requests need to happen on the authenticated connection. So the matching authenticated connection has to be retrieved from the cache. To achieve this, we add a field of type ThreadLocal to sun.net.www.http.KeepAliveCache that can be armed with a value and serves as an additional part of the KeepAliveCache key.
We have thought about alternative solutions for the customer but at the moment there seem to be none. The feature does not affect the API and is only enabled when system property com.sap.jvm.UseHttpKeepAliveCacheKeyExtension is set to true. To use this feature, client code needs an export statement like --add-exports java.base/sun.net.www.http=ALL-UNNAMED.
A customer is accessing an HttpServer backend via HttpURLConnection through JAX-WS. Connections get authenticated by some special mechanism on a per-socket base and subsequent HTTP requests need to happen on the authenticated connection. So the matching authenticated connection has to be retrieved from the cache. To achieve this, we add a field of type ThreadLocal to sun.net.www.http.KeepAliveCache that can be armed with a value and serves as an additional part of the KeepAliveCache key.
We have thought about alternative solutions for the customer but at the moment there seem to be none. The feature does not affect the API and is only enabled when system property
com.sap.jvm.UseHttpKeepAliveCacheKeyExtension
is set totrue
. To use this feature, client code needs an export statement like--add-exports java.base/sun.net.www.http=ALL-UNNAMED
.