Jetty 11.0.26: HTTPS via HTTP proxy fails with PKIX path building unless SSL/truststore explicitly configured #14015
Replies: 7 comments
-
|
Jetty 11 is at EOL. |
Beta Was this translation helpful? Give feedback.
-
|
Your issues have to do with things outside of the control of Jetty.
When working with TLS / SSL on the public internet, it is advisable to always keep your OS cacerts and the JVM up to date for maximum compatibility with the rapidly changing encryption landscape. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @joakime This does not appear to be a JDK issue. Using the exact same JDK and identical JVM/system properties, the behaviour changes between Jetty 11.0.15 (works) and 11.0.16+ (fails) for HTTPS over an HTTP proxy when no explicit SSL/truststore is configured. Observation 11.0.15: succeeds without explicit truststore/SSLContext Here is the test case that is failing -> Test Steps:
|
Beta Was this translation helpful? Give feedback.
-
|
Jetty 11 is EOL.
Upgrade to a supported version of Jetty for further open source help. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @joakime Right now we are facing issue with jersey compatibility with jetty & we are trying to resolve that. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @joakime , Apologies for the previous message—it seems the issue persists even after upgrading to Jersey 12.1.4 or 12.0.30. I've attached a standalone test for your reference: [jetty-client-test.zip]. Observation: The test com.example.JettyHttpsProxyTest.testProxySelectorHttpProxyWithHttpsAndHttpSystemProperty fails only when both https.proxyHost and http.proxyHost system properties are set, while using the custom ProxySelectorHttpProxy. This class is designed to honor the standard JDK proxy properties https.proxyHost and http.proxyHost. Notably, the method RestClientFactoryImpl#configureProxySupport prioritizes https.proxyHost when both are configured. Environment Details: JDK: 21 |
Beta Was this translation helpful? Give feedback.
-
|
Jetty does not honor the Forward proxies must be configured explicitly in the code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
After upgrading from Jetty 11.0.5 to 11.0.26, HTTPS requests made through an HTTP proxy fail with an SSLHandshakeException.
Context -
Client: Jetty HttpClient used via Jersey’s Jetty connector
Jetty versions tested: 11.0.5 (works), 11.0.26 (fails)
JDK: 21
Target URL: https://docs.oracle.com/en/ (public CA-signed)
Proxy: standard HTTP proxy (no proxy TLS interception in the failing case)
Observed error (excerpt)
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
What changed?
With 11.0.5 and earlier, HTTPS over proxy appeared to use the JVM’s default truststore implicitly. Starting in 11.0.26, the same code fails.
Questions
Was there an intentional change in 11.0.26 that stopped implicitly using the JVM default trust store for HTTPS when a proxy is involved?
It appears that Jetty 11.0.16 introduced TLS/SSL hardening, although this is not clearly documented in the release notes: https://github.com/jetty/jetty.project/releases/tag/jetty-11.0.16
The test connects to https://docs.oracle.com/en/, which presents a TLS certificate signed by a publicly trusted CA. With Jetty 11.0.15 and earlier, the client implicitly used the JVM’s default truststore, but from 11.0.16 onward a custom truststore configuration seems required for HTTPS connections when using a proxy.
Are there any deprecations or API changes around proxy configuration and authentication in 11.0.26+ we should adopt to avoid warnings with Jersey’s Jetty connector?
Stack trace -
Beta Was this translation helpful? Give feedback.
All reactions