-
Enhancement
-
Resolution: Unresolved
-
Minor
-
6.2.14.Final
-
None
This PR https://github.com/resteasy/resteasy/pull/4673 fixes an issue where the provided SSLContext and HostnameVerifier were not actually being used when creating HttpURLConnection instances. As a result, custom SSL configurations were silently ignored.
Additionally, the code previously enforced NO_PROXY usage, bypassing the standard Java mechanisms for proxy configuration (e.g. -Djava.net.useSystemProxies, https.proxyHost, https.proxyPort, etc.).
To improve this, I introduced a switch that allows enabling the use of system proxy settings. This way, the proxy behavior aligns with the JVM’s standard configuration, while still preserving the old behavior by default.
On top of that, I also updated the following components:
- URLConnectionClientEngineBuilder and ResteasyClientBuilder: now properly propagate and respect the JVM proxy/SSL settings so that clients created through these builders behave consistently.
- Apache client implementation: extended with equivalent support for custom SSL configuration and system proxy handling, ensuring feature parity across the different client engines.
Key points:
- Correctly apply the provided SSLContext and HostnameVerifier to HttpsURLConnection.
- Replace the hardcoded NO_PROXY with an optional mechanism that respects JVM proxy settings.
- The new proxy handling is opt-in, so this change is not breaking existing behavior.
- Ensure builders (URLConnectionClientEngineBuilder, ResteasyClientBuilder) and the Apache implementation fully support these features.
Why this matters:
- Ensures that custom SSL/TLS settings (such as trust stores or custom hostname verification) are correctly honored.
- Restores compatibility with enterprise environments where proxies are configured via system properties.
- Provides consistent behavior across different client engine implementations.