Commit Graph

2071 Commits

Author SHA1 Message Date
olivier lamy e1371a1c13 happy new year
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-01-02 21:54:05 +01:00
Simone Bordet af7cb94528
Merge pull request #4428 from eclipse/jetty-9.4.x-4427-httpclient_retried_request_duplicates_cookies
Fixes #4427 - Retried request duplicates cookies.
2019-12-19 22:00:15 +01:00
Simone Bordet e4f1106f09 Fixes #4421 - HttpClient support for PROXY protocol.
Fixed visibility of ProxyProtocolConnection.
Must be protected because it's the return type
of protected methods.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-19 10:11:54 +01:00
Simone Bordet bea7f1a5cf Fixes #4421 - HttpClient support for PROXY protocol.
Improved support for Type-Length-Value (TLV) objects.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-17 23:26:28 +01:00
Simone Bordet 91239b01e3 Fixes #4427 - Retried request duplicates cookies.
Introduced HttpRequest.normalized() to test and set whether
the request has already been normalized.
Added test case and few cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-17 20:16:46 +01:00
Simone Bordet 129a51c7a2
Fixes #4421 - HttpClient support for PROXY protocol. (#4424)
* Fixes #4421 - HttpClient support for PROXY protocol.

Implemented support for the PROXY protocol in HttpClient.

Introduced Request.tag(Object) to tag requests that belong
to the same group (e.g. a client address) so that they can
generate a different destination.

The tag object may implement ClientConnectionFactory.Decorator
so that it can decorate the HttpDestination ClientConnectionFactory
and therefore work both with and without forward proxy configuration.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-17 10:36:16 +01:00
Simone Bordet fa973a2df8
Merge pull request #4380 from eclipse/jetty-9.4.x-4374-httpclient_content_listener
Fixes #4374 - Jetty client: Response.AsyncContentListener.onContent i…
2019-12-16 18:01:27 +01:00
Simone Bordet 364ded9f73
Merge pull request #4391 from eclipse/jetty-9.4.x-3512-httpclient_multipart_close
Fixes #3512 - File descriptor is not released after zip file uploaded…
2019-12-07 12:38:40 +01:00
Simone Bordet 2ef02da1bd Fixes #4366 - HTTP client uses SOCKS4 proxy hostname for SSL hostname verification.
Now setting correctly the host and port to the server destination
_after_ the SOCKS tunnel is established, similarly to what is done
for the HTTP CONNECT tunnel.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-03 21:40:55 +01:00
Simone Bordet 9628ea3bc1 Fixes #3512 - File descriptor is not released after zip file uploaded via jetty-client.
In case of multiple parts only the last iterator was closed.
Now, every part's iterator is closed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-03 11:36:53 +01:00
Simone Bordet 902603fc9e Fixes #4374 - Jetty client: Response.AsyncContentListener.onContent is not called.
Now the various content listeners inherit from each other, like
it should have been from the beginning.
This also allowed to remove code duplication due to the default
implementation of the methods in various places.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-11-29 12:05:30 +01:00
olivier lamy dc1a3384b0 ooops typo
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-11-27 07:18:59 +10:00
olivier lamy c291df5463 we do not want dependencies definied as range even for test transitive dependencies
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-11-27 07:04:57 +10:00
Joakim Erdfelt 0f7a3b2d91 Updating to version 9.4.25-SNAPSHOT 2019-11-20 16:08:38 -06:00
Joakim Erdfelt 363d5f2df3 Updating to version 9.4.24.v20191120 2019-11-20 15:25:01 -06:00
Joakim Erdfelt dc03431de2 Merge branch 'release-9.4.23' into jetty-9.4.x 2019-11-20 07:14:53 -06:00
Simone Bordet e89e8ae16e Improved toString() for ConnectionPool implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-11-19 10:43:09 +01:00
Joakim Erdfelt 453d41940b Updating to version 9.4.24-SNAPSHOT 2019-11-18 13:52:51 -06:00
Joakim Erdfelt abbccc65d6 Updating to version 9.4.23.v20191118 2019-11-18 13:09:44 -06:00
Simone Bordet bf2482a7ea Moved implementation from Adapter classes to default methods in
the interface to avoid binary compatibility problems in case the
interface is changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-11-18 10:29:55 +01:00
Simone Bordet aa57463175 Fixes #4301 - Demand beforeContent is not forwarded.
Now correctly handling no demand before the content
in FCGI and HTTP2 transports.

Fixed HttpRequest to correctly forward onBeforeContent()
to wrapped listeners.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-11-12 23:33:21 +01:00
Simone Bordet 4825832a53
Merge pull request #4286 from eclipse/jetty-9.4.x-4277-httpclient_async_gzip
Fixes #4277 - Reading streamed gzipped body never terminates.
2019-11-12 19:04:05 +03:00
Lachlan c336616c96
Issue #2709 - reduce default headerCacheSize to 1024 (#4292)
make headerCacheSize on HttpReceiverOverHTTP configurable

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-11-08 21:57:49 +11:00
Simone Bordet a83c297a11 Fixes #4277 - Reading streamed gzipped body never terminates.
Fixed handling of demand in case of gzipped response content.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-11-07 22:32:11 +01:00
Greg Wilkins 869c3b51ce
Issue #4265 Remove doError (#4266)
* Issue #4265 Remove doError

The doError method and the ErrorDispatchHandler class were
hang overs from when we needed to dispatch into a context to get sendError called, which would then generate the error page.

Now sendError doesn't do any generation, rather it changes state that arranges either for a minimal error page to be generated or an ERROR dispatch to a real handler/servlet to generate the error page.

Thus the ErrorDispatchHandler and doError methods can now be removed.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 Remove doError

Moved the error page dispatching logic back to the ErrorHandler class to assist with backwards compatibility

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 Remove doError

Moved the error page dispatching logic back to the ErrorHandler class to assist with backwards compatibility

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 doError

Updates from review.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-05 08:45:46 +11:00
Joakim Erdfelt 1ed13b6b30 Updating to version 9.4.23-SNAPSHOT 2019-10-22 09:19:41 -05:00
Joakim Erdfelt b1e6b55512 Updating to version 9.4.22.v20191022 2019-10-22 08:20:50 -05:00
Simone Bordet 73eb82c20f Issue #4217 - SslConnection.DecryptedEndpoint.flush eternal busy loop.
Updates after review.
Added test case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-19 20:06:10 +02:00
Simone Bordet 991cf20cce Issue #4217 - SslConnection.DecryptedEndpoint.flush eternal busy loop.
Releasing the decrypted input buffer so that it can be re-acquired
with an expanded capacity.
Looping around only if the buffer size has changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-19 12:27:58 +02:00
Simone Bordet 2e633a4e86 Fixes #4217 - SslConnection.DecryptedEnpoint.flush eternal busy loop.
Releasing the encrypted output buffer so that it can be re-acquired
with an expanded capacity.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-17 19:41:52 +02:00
Simone Bordet 20e0453da8 Merged branch 'jetty-9.4.x' into 'jetty-9.4.x-4201-httpclient_throw_sslhandshakeexception'. 2019-10-16 18:51:15 +02:00
Simone Bordet 1e360244a5 Fixes #4209 - Unused TLS connection is not closed in Java 11.
Added workarounds for the Java 11 behavior.

In fill(), call closeInbound() if we filled -1 and the handshake
did not start yet. This avoids to send a ClientHello to the peer
even if we are closing.

In flush(), if the handshake status is NEED_UNWRAP but we are
closing, force a wrap().

Added test cases.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-16 13:10:40 +02:00
Simone Bordet 4769de8a2b Issue #4209 - Unused TLS connection is not closed in Java 11.
Code cleanup.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-16 13:02:24 +02:00
Simone Bordet 3ce87f717c Fixes #4201 - Throw SSLHandshakeException in case of TLS handshake failures.
Now rethrowing other exceptions as SSLHandshakeException
if they happen during the TLS handshake.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-15 16:44:30 +02:00
Simone Bordet cf687457e7 Issue #4177 - Configure HTTP proxy with SslContextFactory.
Small fixes after merge.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-10 10:41:42 +02:00
Simone Bordet a73568df28 Fixes #4177 - Configure HTTP proxy with SslContextFactory.
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-10 10:00:17 +02:00
Simone Bordet c8175ec107 Fixes #4177 - Configure HTTP proxy with SslContextFactory.
It is now possible to pass a `SslContextFactory.Client` to HttpProxy
so that it is possible to use a keystore for the proxy communication
and another keystore for the server communication.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-09 17:37:00 +02:00
Simone Bordet 742f564332 Fixes #4170 - Client-side alias selection based on SSLEngine.
Fixed setting of host/port in AbstractConnectorHttpClientTransport
and HttpProxy so that the creation of SSLEngine can use the proper
host/port pair, and can be subsequently used in TLS components.

Introduced SslContextFactory X509ExtendedKeyManagerWrapper and
X509ExtendedTrustManagerWrapper as utility classes used internally
and in tests.

The test case for this issue required 3 keystores, so other test
classes have been refactored to use the new keystores.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-08 18:32:23 +02:00
Simone Bordet a4603c4237 Issue #2429 - Review HttpClient backpressure semantic.
Updated after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-08 00:52:11 +02:00
Simone Bordet ef05f730e6 Issue #4115 - Drop HTTP/2 pseudo headers.
Added Javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-03 16:58:16 +02:00
Simone Bordet 3be178c966 Merged 'jetty-9.4.x' into 'jetty-9.4.x-2429-httpclient_backpressure'. 2019-10-03 13:17:39 +02:00
Joakim Erdfelt 6fc42d8ba2 Merge branch 'release-9.4.21' into jetty-9.4.x 2019-10-01 13:35:43 -05:00
Simone Bordet 72d1a297a0
Merge pull request #4109 from mofleury/jetty-9.4.x
Support meaningful JMX ObjectNames for HttpDestinations by avoiding race condition at creation
2019-10-01 17:31:45 +02:00
Marc-Olivier Fleury 8e51a4d532 adjusted formatting to follow standards
Signed-off-by: Marc-Olivier Fleury <mofleury@gmail.com>
2019-09-30 08:34:54 +02:00
Simone Bordet 2c75e876a3 Fixes #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Now exceptions thrown by fill() or flush() are stored in a field.
Further fill() operations will rethrow the original exception rather
than returning -1.

Returning -1 to application was causing them to close() with a generic
failure that was triggering the EOFException reported in this issue.

Now applications see the original exception and can close() with the
proper cause.

Re-enabled HostnameVerificationTest that was reproducing this issue
reliably but was @Disabled a while back and never re-enabled.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-26 18:30:43 +02:00
Simone Bordet d12df30df7 Issue #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-26 18:18:13 +02:00
Joakim Erdfelt 7807eafad9 Updating to version 9.4.22-SNAPSHOT 2019-09-26 10:46:28 -05:00
Joakim Erdfelt 72970db61a Updating to version 9.4.21.v20190926 2019-09-26 09:59:15 -05:00
Simone Bordet b3be28086b Fixes #4113 - HttpClient fails with JDK 13 and TLS 1.3.
1. Now forwarding the fillable event rather than assuming that is due
to garbage bytes or by a server close. This ensures that a HTTP read
consumes the TLS bytes and the `NewSessionTicket` message.
2. Avoid to set the `SslConnection` onto the `EndPoint` in
`SslClientConnectionFactory` - this allows upgrades to work properly,
for example when tunnelling through a secure proxy.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-23 17:59:37 +02:00
Marc-Olivier Fleury ebe28c27e4 using computeIfAbsent to avoid the duplicate registering of Destinations in the MBean Server
Signed-off-by: Marc-Olivier Fleury <mofleury@gmail.com>
2019-09-20 14:55:45 +02:00