* Introducing jetty-slf4j-impl
* Make Jetty use org.slf4j
* Removed most of org.eclipse.jetty.util.log classes
* Left org.eclipse.jetty.util.log.Log and
org.eclipse.jetty.util.log.Logger but as
simple bridge classes that are deprecated
* Migrated code using org.eclipse.jetty.util.log.StacklessLogging
to org.eclipse.jetty.logging.StacklessLogging found in
the jetty-slf4j-impl
* Moved logging start modules from jetty-util to jetty-home
* Simplified logging start modules
* Updated code that was using StdErrLog directly
* Updating module-info.java for org.slf4j
* removing org.eclipse.jetty.util.log.class references
* jetty-start supports manually declared default provider
+ and we use it to default "logging" to the "logging-jetty" provider
* Cleaning up jetty-maven-plugin and IT testing for Logging
* Using old slf4j for it testing
* Updating compiler config to show Xlint:exports warnings
* Updating console-capture and logging-noop
* Adding slf4j bridge (capture) jetty modules
* Updates to jetty logging module locations
* Changing reference to slf4j dependent mod
* Process requested enabled modules in topological order
* Limiting inclusions in shaded jetty-start
+ Also adding note to jetty-util classes that are used by
jetty-start
* Default logging level on baseline logging config is INFO (not DEBUG)
* Changing from system to server classes in logging
* Updating other modules to use new logging names
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Moved implementation of UpgradeTo from HTTP2ServerConnection
to HTTP2Connection, since now also the client connection
can be upgraded to.
* Split HTTP2Session.newStream(), since now the client must
be able to create the implicit stream 1 corresponding to
the HTTP/1.1 upgrade request, so that the HTTP/2 response
after the upgrade finds the stream.
* The HTTP/1.1 upgrade mechanism has been generalized.
Before it was based on HttpConnectionUpgrader and a hook
in HttpChannelOverHTTP.exchangeTerminating().
Now it is based on UpgradeProtocolHandler that when sees
a 101 response it will trigger the upgrade mechanism.
* Introduced ConnectionPool.accept(Connection) to transfer
a connection from the HTTP/1.1 connection pool to the
HTTP/2 connection pool after the upgrade.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced Request.Content with a reactive model to provide
request content.
Introduced RequestContentAdapter to wrap ContentProviders
into Request.Content.
Updated implementation to use the reactive model rather than
the old pull model.
Reimplemented all ContentProviders in terms of Request.Content.
Converted most of the tests from ContentProvider to Request.Content.
Updated proxy servlets and documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Generified the API to expose TLVs, so that they are all exposed,
not only the custom TLV types in the 0xE0-0xEF range.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Updated the keystores to PKCS12 and added the Basic Constraint CA:true
to the server certificate.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
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>
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>
* 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>
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>
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>
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>
Now CONNECT with :protocol requests will demand DATA frames only
after the upgrade.
Other requests will demand DATA frames during the handling of
the request HEADERS frame.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Avoid creating listener list for rarely used requestAttributeListener
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
Keep a list of EventListeners in the AbstractConnector to make it
more efficient to add and iterate over them.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Use addEventListener rather than bespoke listener methods.
Support getEventListenerBeans at Container level for fast lookup
improve javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed test
more javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
Don't use null for empty lists of listeners
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fix merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Resolve differences between eventListeners added as beans and beans
added as EventListeners. The behaviour should now be the same
regardless of how they listener is added and all listeners are now
beans.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Add only SelectorManager listeners to manager from connector
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
Fixed javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
removed old TODO
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
connector cannot be null
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964
AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
fixed merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fixed javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #2578 EventListener
removed the ability to set/clear context listeners
Instead just remove non-durable ones.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Simplified listener handling by avoiding null connector, previously
only needed for testing.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* fixed bad merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Fixed test that assumed HttpChannel listeners were not cleared by a recycle
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3964 Listeners
Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.
Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* removed deprecated cyclic HttpChannel listeners
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* removed deprecated cyclic HttpChannel listeners - import
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4003 Cleanup quickstart
* Fixed tests that scan for "Started" on console
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
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>
* 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>
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>
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>
Now rethrowing other exceptions as SSLHandshakeException
if they happen during the TLS handshake.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
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>
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>
Made jetty-alpn-client required by jetty-client.
Fixed groupId for test-proxy-webapp.
Added test case for the failing configuration.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
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>
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>
Introduced a Response.DemandedContentListener to explicitly separate
the will to request more content from the notification that the content
has been consumed.
Updated all transports to follow the new semantic: rather than waiting
for the callback to complete before delivering more content, now they
wait for the demand to be positive to deliver more content.
Since now the content may be unconsumed but there can be more demand,
all transport implementation had to be changed to use RetainableByteBuffer
to retain content buffers that were not consumed.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes#250 - Implement HTTP CONNECT for HTTP/2.
Modified HTTP/2 implementation to support the CONNECT method.
Implemented semantic defined by RFC 8441.
Implemented section 8.3 of RFC 7540.
Introduced HTTP2Client.streamIdleTimeout.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
internal default values.
We want to keep those values as a hedge against future default
value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Modified the sender logic to allow specific subclasses to decide
when to send the trailers, if any.
This allows HTTP/2 to correctly compute the end_stream flag and avoid
sending empty trailers frames with end_stream=true.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
+ Deprecated B64Code
+ All code that isn't B64CodeTest is now using java.util.Base64
+ B64CodeTest is updated to confirm change to java.util.Base64
is possible without change in behavior. Just have to make
sure you use the appropriate Encoder / Decoder for the task
at hand (default vs mime vs url)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Updating to jetty-test-helper 4.2.1 with new Net.class
+ Assume.assumeTrue(Net.isIpv6InterfaceAvailable());
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
+ Updating to jetty-test-helper 3.1.1 with new Net.class
+ Assume.assumeTrue(Net.isIpv6InterfaceAvailable());
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* exclude ipv6 test as currently failing on kubernetes, using junit tag and ci profile activated via Jenkinsfile
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
* upgrade surefire to 3.0.0-M3
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Introduced SslContextFactory subclasses Client and Server.
Replaced all usages of SslContextFactory with either Client or Server
as required.
Refactored configuration checking so that warnings are not emitted
when non necessary.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reviewed the implementation.
Got rid of the single channel stored in the HttpClientTransport.
Re-enabled tests on the Unix socket transport.
Updated JNR to 0.22.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Updates after review.
Removed special logic to test for same URI redirection,
so it will fall back into the normal case where redirects
are counted against a maximum.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Simplified ProxyProtocolClientConnectionFactory
to use Origin.Address rather than InetSocketAddress.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Removed timeout after copying the request in case of redirects
(and authentications), to avoid that the timeout listener is
notified of intermediate exchanges and resets the timeout.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically.
Refactored other transports and HttpDestination, removing now unnecessary classes.
Introduced ProxyProtocolClientConnectionFactory and used it for testing.
Updated OSGi tests now that jetty-client depends on jetty-alpn-client.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Modified jetty-client content decoding to be fully non-blocking;
this allows for a better backpressure and less usage of the buffer
pool.
Modified GZIPContentDecoder to aggregate decoded ByteBuffers in
a smarter way that avoids too many data copies and pollution of
the buffer pool with intermediate size buffers.
Removed duplicate test GZIPContentDecoderTest.
Improved javadocs and improved AsyncMiddleManServlet
to release buffers used by the GZIPContentDecoder.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* add jdk12 build stage
* test last release of infinispan for jdk12 build
* fix upperBound dependency for jboss logging
* upgrade juniper to 5.4.0 and disable infinispan test if JRE.JAVA_12
* Fixed annotations to exclude any JDK > 11 for 3 tests.
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reviewed module-info.java files.
For those that have a "requires static" added a comment about
why the dependency is optional.
Rearranged directives in alphabetical order.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Added a SslHandshakeListener to SslConnection that performs
the host name verification (only on the client) if the
HostnameVerifier has been configured in SslContextFactory.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reverted refactoring of newConnection() to avoid
to bind the class to a too specific abstract method.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.
Refactored also HTTP2Client to reference ClientConnector.
Refactored tests accordingly to the changes introduced in the
implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Gave onOpen, onError and onClose callback signatures
Illegal to ask for demand prior to onOpen success
added tests for various onOpen scenarios
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Reverted refactoring of newConnection() to avoid
to bind the class to a too specific abstract method.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.
Refactored also HTTP2Client to reference ClientConnector.
Refactored tests accordingly to the changes introduced in the
implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
to match the new Jetty Servlet API jar.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes#2978 - Add module-info to relevant Jetty modules.
Added module-info.java for Jetty modules that are not test modules.
Moved jetty-http test utility classes to new module "jetty-http-tools".
Removed generation of test-jar from websocket-core.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Don't call handleContentMessage after content call if the content call
returns true.
This is a slight bending of the parser contract to work around the current
client interpretation that a true return will prevent other events from being
delivered.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Issue #3038 - SSL connection leak.
Fixed SSL spin caused when fill had NEED_WRAP, but a flush/wrap
produced 0 bytes and stayed in NEED_WRAP
Removed check of isInputShutdown prior to filling that allowed EOF to
overtake data already read.
Fix for leak by shutting down output in HttpConnection if
filled -1 and the HttpChannelState was no longer processing
current request.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixes Issue #3103 - HttpClient buffer leak found by dump improvements
The leak problem was an additional, unnecessary, call retain() in ResponseNotifier.notifyContent() that was leaking `ByteBuffer`s.
Revert to the not-so-good bean handling for the HttpClient executor
Added TODOs so that the bean handling can be updated in future.
Deprecated Websocket client setters that hide dependency on internal HttpClient instance.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Adding more todos
* More websocket test updates
* Adding more information to exception about mismatched hash
* AcceptHash improved testing
* Prevent duplicate request headers
* Removing ability to use LocalFuzzer entirely (until its fixed)
* JSR356 HandshakeResponse header modifications are now allowed during Configurator
* Correcting MessageSink creation
* Using proper sub-protocol
* Metadata remembers OnMessage.maxMessageSize now
* Minor test updates
* Issue #2172 - Fixing JSR-356 Decoder discovery and OnMessage wiring
* More websocket test updates
* Update for null/empty payload
* Partial String Message Sink fix
* More websocket fixes around InputStream handling
* Moving proposed Abstract FrameHandler hierarchy into core main
* More testing fixes, along with a change to use the new core Abstract*FrameHandler
* Adding WebSocket URI validation
* Updating copy found in other API with improvements made in first API.
* More websocket test updates
* Fixing compilation
* WebSocket test fixes
* Fixing ContinuationTest assertions
* fixed package
* Added some better examples of QuotedCSV
I think this test is trying to use QuotedCSV in the wrong way, as it often is offering values when it should be testing parameters.
I have added some examples to show that QuotedCSV is capable of handling the quotes, spaces and embedded commas of the tests, but only
for parameters and not for values. The question is, is this sufficient for websocket?
* Improve close handling
The handling of a Close Frame may close the endpoint, so parsing should not continue
* moved old AbstractFrameHandler to test
* implement ingoing and outgoing frame sequence checking
* More work on javax.websocket parameterized server
* Bumping up pom plugin versions to jetty-9.4.x standards
* Merging up Jenkinsfile to attempt to fix CI build issues
* JSR356 @PathParam testing
* More WebSocket testing updates
* More WebSocket testing updates
* WebSocket Idle Timeout from FrameHandler specific policy
* WebSocket/JSR Pong support
* WebSocket/JSR Correcting MessageHandler.Whole<PongMessage> handling
* URL Decode UriTemplatePathSpec values
* Fixing test expectations
* Fixing AbstractWholeMessageHandler buffer flip
* More websocket test fixes
* Updated ALPN version for JDK 8u181.
* Removing QuotedUtil from WebSocket-core
+ Moved to QuotedCSV for most usages
+ Introduced HeaderUtil to satisfy remaining use cases
* Review of HttpClient names and Thread names.
+ Javax WebSocket Server = "Javax-WebSocketServer@####"
+ Javax WebSocket Client = "Javax-WebSocketClient@####"
* added OpCodeTest.java
* Minor Frame cleanup
* MessageOS cleanup
* Made the OpCode of WebSocket Frame immutable.
Frames can no longer be set as a continuation and should now be copied using the ContinuationFrame constructor
DataFrames can no longer be created without one of the subclasses as the public constructor was removed in favour of newDataFrame method
* Chat test
* Work on Chat Test
Moved implementation of assertValid to WebSocketFrame
Removed getFinRsvOp
* removed constructors for DataFrame using a basedOn Frame
instead use constructors with opCode, payload and fin bit
* refactor of WebSocket Frames WIP
* WIP: resolved failing tests
* CloseStatus rework, now use CloseStatus.toFrame to create Close Frames
new DelegateFrame class which ReadOnlyFrame extends
trim utf8 byte array in CloseStatus to utf8 character boundaries only
* working on test to test socket io erros in websocket-core
* renaming for clarity
Gave up on maintaining old names, as this is a different package anyway so some adaption will be needed regardless.
* Moved AbstractFrameHandlers to common
Only have a AbstractTestFrameHandler in core
* Close uses CloseStatus
Reduced the parsing and generation of CloseStatus when closing
* merge
* work on WebSocketTest
* cleanup log
* wip
* files missing comment header
jetty-jmh was using 9.4.12-SNAPSHOT now using 10.0.0-SNAPSHOT
* thread names
* remove sequence check from parser
* minor cleanups
* Call frameHandler externally to parser
* OpCode.check now throws ProtocolException instead of returning boolean
changed ProtocolException messages in OpCode.check
* removed Frame.Type and use OpCode instead
separated out FrameValidation for parser into method in WebSocketChannel
* moved remaining frame validation checks into WebSocketChannel
* referenced counted buffer
* cleanups
* wip on demand side
* First attempt at demandable
* demand control
* clean up reference counting
* clean ups
* WebSocketServerTest
* wip
* fixed auto fragmentation
* simple demand test
* test demand and retain
* Added validation back into the Parser
split up validation in WSChannel into methods for incoming and outgoing
fixed various tests in websocket-core
* more tests
* fixed remaining tests failing due to the changes to frame validation
* cleanups
* more autobahn refixes
* adjust mask for auto fragments
* clear mask
* fully close on unrecoverable error and not wait for close response
* Removed the CoreFuzzer and ContinuationTest
These tests are now covered elsewhere.
* remove declared exception onClosed
* Test delay close
* Test handler close
* fixed test dependency
* moved the frame sequence check from OutgoingState from after the ExtensionStack to channel.sendFrame
changed error handling to fail the callback of invalid/outOfSequence frames
added WebSocket Close tests revealing some problems with demand in state ICLOSE
* cleanup
* timing issues with WebSocketCloseTest
* test cleanups
* Cancel demand on close
* removed frame validation from generator
* finished close testing
* Issue #2901 - Moving Http Upgrader to Http Conversation
+ Solves for Authentication and Redirect
* changes from #2902 to jetty-10.0.x
* Validation Extension
introduced a ValidationExtension to do frame validation in the ExtensionStack
added the WebSocketChannel to ExtensionStack.connect to set it on the Extensions
* added parameters for ValidationExtension to choose what to validate
* ValidationExtension Cleanup
ValidationExtension now uses the Validation methods from its WebSocketChannel
simplified the parameter passing to the ValidationExtension
* core cleanup
* Fixed intermittent test failures
* clean up duplicates and imports
* simplified package structure
* many cleanups, simplifications and duplication removal
* cleanup
* added utf8 validation for text frames into ValidationExtension
added tests for utf8 validation
* create ValidationExtensionTest
* cleanup
* merge with jetty-10
update websocket to junit5
* fix to autobahn client report directory
* Fixes and cleanup
Fixed initial buffer too large for websocket buffer
less verbose debug
better debug
* Removed behavior from policy
* cleanup after merge from hell
* bug fixes and cleanups
* refactor packages with JPMS in mind
* unit test for TextMessageHandler
* cleanups
* more cleanups
* provided client/server dependencies
* fixed bad refactor
* use lambdas for TextMessageHandler
* cleanup
* cleanup
* cleanups
* cleanup of websocket-common framehandlers
* reverting to jetty websocket api from 9.4
* better chat
* renamed websocket common to util
* save wip on jetty-websocket-tests
* giving up on jetty-websocket-tests as mostly duplicated tests
* renamed websocket-util back to websocket-common
* moved InvalidWebSocketException to javax common
* reworked TextMessageHandler to MessageHandler
now handles binary messages as well
* implemented getByteBufferPool in remaining DummyChannel classes
* Moved the abstract Frame and Message handlers out of websocket-common
* replaced usages of AbstractWholeMessageHandler with CoreMessageHandler
renamed MessageHandler to CoreMessageHandler
* removed AbstractFrameTypeHandler
* cleanup
* jetty-websocket-common passing tests without websocket-common dependency
* fixed compile errors
* renamed MessageHandler
* Removing reference to websocket-server (no longer exists)
* Removing, Extensions now exist in websocket-core
* Do not append an empty ByteBuffer
* NPE Fix for empty/unused UTF-8 String Builder
* NPE Fix for SendPartialBinaryFrameHandler test
* Punching holes in WebAppContext needed for JSR356 use
* Updating "9.x.x" to "10.x.x"
* Removing Bad URI test case that is ignored
* Fixing test expectation now that we moved to QuotedCSV
* Adding TODO about onOpen failure requiring onError + onClose.
* Throwing JSR356 DeploymentException on addEndpoint() failure
* Test cleanup (for better error messages)
* Adding some comments to explain wrapNonVoidReturnType()
* cleanup methodHandle return type filtering
* test fixes
* Fix change return type to Void
* Fixed test by wiring up MessageHandler
* test cleanups
removed changeReturnType for MethodHandle as filterReturnValue already changes to return type of the filter
* fixed MessageReceivingTest.testPartialBinaryFrameHandler
* Core BatchMode replaced by boolean
* fixed LargeContainerTest.testEcho by allowing the policy to be set on the WSServer as an attribute
* acquire batchBuffer before calculating batchSpace in FrameFlusher
* Deprecated WebSocketPolicy
* Fixing MessageReceivingTest
* Refactoring out websocket-servlet
+ WebSocketPolicy removed from websocket-servlet
+ websocket-common is removed
+ Migrating back up to APIs
* WIP removing core policy
* added missing copyright headers
* customize client session
* customize cleanup
* wip
* wip
* Removing WebSocketPolicy usage within websocket-core
* Allowing DummyCoreSession to have a Behavior
* Removing core WebSocketPolicy.clonePolicy() - no longer used
* Jetty Native WebSocket now compiles / tests
* Remember WebSocketServletFactoryImpl as Context Attribute
* JSR356 codebase now compiles
* updated websocket servlets
* fix handling for no max message size
* Fixed LargeContainerTest.testEcho
Changed WebSocketServletFactoryImpl.defaultAutFragment to true
only check the incoming frame size if autoFragment is false
* Added WebSocketConstants to avoid duplicate default locations
* applications extensions discovered via headers
* fixed ConfiguratorTest.testNoExtensionsConfigurator
* cleaned up extension negotiation
* cleaned up extension negotiation
* cleanups
* Convert exceptions to API versions
* cleanup imports
* convert requestURI to a WebsocketURI in Negotiated
* fixed SessionTrackingTest
* moved session tracking management to be done by the JavaxWebSocketFrameHandler
* Cleanup dump for jdk11 classloaders
* fix to ConfiguratorTest
added the EchoSocket endpoint on the ServerContainer instead of using server.registerWebSocket
* Simplify websocket-servlet
fixed jetty websocket chat example
fixes for javax websocket chat example
fixed Upgrade response header issues
Set default configurations
improved dump
depends on javax server impl
do not expose core classes
fix javadoc
removed FrameHandlerFactory self reference
* Removed -impl from javax client and server
* Fixed common tests for onClosed event
* Improve creation of JavaxWebSocketServerContainer
Better handling of executor and httpClient as managed beans
* Fixed MessageOutputStream using empty buffers and looping forever
no longer enforce maxTextMessageBufferSize on partial messages
* Updates after review
reintroduced WebSocketServletFactory
reverted other API changes
* Ignored TextStreamTest tests incorrectly assuming no frame fragmentation
When message fragmentation is implemented in PartialStringMessageSink
then update these tests to check on the server side for no buffers
larger than the maxTextMessageBufferSize.
* fixed check for previous WebsocketUpgrade filter
Disable the AltFilterTest until problems of the WebSocketUpgradeFilter
attributes on the ServletContext are fixed.
* fixed flaky SessionTrackingTest by waiting for Sessions to open
* remove payload length check for outgoing frames
fix bug sending frames after they have failed validation checks
* reverted maven coords for javax client and server
* updated to latest jetty-10 dump changes
* Fix to WebSocketUpgradeFilter Attributes on the ServletContext
Removed deprecated method
WebSocketUpgradeFilter.configureContext(ServletContext)
Changed return type of
WebSocketUpgradeFilter.configureContext(ServletContext) to void.
WebSocketUpgradeFilter.configureContext was checking the ServletContext
for a WebSocketUpgradeFilter set as an attribute before creating a new
one. The FilterHolder from web.xml is being set as an attribute in init
which is called which happens after configureContext.
So instead of checking the attribute in
WebSocketUpgradeFilter.configureContext, we are now searching through
the filters on the ServletHandler to see if a WebSocketUpgradeFilter
has been registered with the CONTEXT_ATTRIBUTE_KEY.
* cleanup and identifying problems with FrameHandlerMetadata
* properly cache Metadata and copy MessageMetadata
properly cache Metadata in the FrameHandlerFactory using the metadataMap
copy the MessageMetadata from Metadata to prevent mutating the MethodHandle
* added new WebSocketServerContainerExecutorTest
removed DelayedStartClientOnServerTest which doesnt seem to be a valid
test when executors are shared
removed last check for executor==null in JavaxWebSocketServerContainerInitializer
as the threadPool is always created in the server
* reformatted websocket code
* reformat code
* Rervert unnecessary changes from 10.0.x
* Rervert unnecessary changes from 10.0.x
* fix build issues testing Hazelcast sessions
* QuotesDecoderTest sessions not being closed
* Fixed CookiesTest
CookiesTest.testCookiesAreSentToClient was failing due to the
Assertion being caught and logged by the upgrade request
the response is now captured by a FuturePromise and the assertions are
done in the main test
the reason the assertion was failing was due to lowercase "set-cookie"
instead of "Set-Cookie"
* fixed maven coords
* javadoc fixes
* fixed javadoc
* revert maven artifact names
* cleanup after review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
+ Can get HttpCompliance from HttpConfiguration now
+ Signature change to HttpConnection to avoid duplicate arguments
on constructor.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Cleanup the dump implementation
* improved the clarity of utility methods for dump and updated most dump methods
* fixed upgrade filter dump
* Improved dump after review
* Moved dumpObjects to Dumpable
* implemented dumpBeans with dumpObjects
* less verbose dump
* Dump streams
* fixed dump test
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Reviewed other possible places where max local stream count may
overflow.
Fixed handling of HTTP/2 stream idle timeouts.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Issue #2954 Report badmessage cause
Pass BadMessageException from parser to HttpReceiverOVerHTTP
This change has already mostly been made in 9.4, so essentially this is a back port. However the
primary signature of HttpParser.Handler for badMessage has not been changed and a default method
used to handle the cause. This avoids breaking any usages of the interface.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Running tests only on JDK 11, as apparently other JDKs have problems
with AES encryption/decryption.
Another hypothesis is that Kerby does AES encryption differently from
what earlier JDKs expect.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Avoid hardcoded KDC port in tests.
Updated Krb5LoginModule options with refreshKrb5Config=true,
to make sure the KDC configuration is re-read for every test.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Renamed server-side classes and added javadocs.
Deprecated old server-side classes in favor of the new ones.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
- this will be a formal release once this issue has been
resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration
junit 4 | junit 5 / jupiter
------------ | -----------
@Before | @BeforeEach
@After | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass | @AfterAll
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
- this will be a formal release once this issue has been
resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration
junit 4 | junit 5 / jupiter
------------ | -----------
@Before | @BeforeEach
@After | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass | @AfterAll
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
Issue #2711 - TLS 1.3 compliance.
Disabled few tests that are TLS 1.2 specific.
Renegotiation in SslConnection is now skipped for TLS 1.3.
Replaced SNI keystore DSA certificate with RSA certificate.
First full build achieved with JDK 11+28.
Small changes after review.
Modified the test case to pass in JDK 8, where the implementation
throws SSLException, while in later JDKs throws SSLHandshakeException.
Minor cleanup
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Increased complexity of regex in order to use only one regex pattern and reworked state machine into simple for loop
Signed-off-by: lachan-roberts <lachlan@webtide.com>
Splitting elements into list using QuotedCSV and processing with state machine instead of using regex to split into multiple challenges.
Signed-off-by: lachan-roberts <lachlan@webtide.com>
Major refactor of SslConnection to address #2233 and to simplify in preparation for java-11 support.
Made the `needFillInterest` and `onIncompleteFlush` methods the primary stateful methods with state for fill and flush side that does not reproduce state already held by the SslEngine itself.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>