Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK11 support: upgrade to Jetty 9.4.19, Restlet 2.4.0 and drop JDK 7 support #276

Merged
merged 6 commits into from
Aug 7, 2019

Conversation

ato
Copy link
Collaborator

@ato ato commented Aug 6, 2019

Jetty 9.4.12+ is required for TLS to work correctly under JDK11 (due to SSL handshake failures).

Unfortunately Jetty 9.4 requires JDK 8. This means we can't support JDK 11 and 8 at the same time so we drop support for JDK 7.

We also upgrade Restlet to 2.4.0 for compatibility with the new version of Jetty.

There is one intentional change in behaviour to simplify upgrading. We remove a workaround for an old webkit bug where the browser claimed to prefer application/xml over text/html. The bug was fixed in 2011.

Summary of Jetty API changes:

  • package names changed such as org.mortbay -> org.eclipse
  • SocketConnector and SslSocketConnector merged to ServerConnector
  • HashUserRealm split into UserStore and HashLoginService
  • SecurityHandler -> ConstraintSecurityHandler

Summary of Restlet API changes:

  • some classes have moved package (Request, Response, Router etc)
  • ServerResource replaces Resource
  • represent(), acceptRepresentation() renamed to get(), post()
  • constructors were replaced by an init() method
  • setModifiable() was removed
  • getRequest().getEntityAsForm() -> new Form(entity)
  • Guard -> ChallengeAuthenticator

ato added 6 commits August 5, 2019 14:35
Fixes #268 ssl handshake_failure. Support for jdk11 was added in jetty
9.4.14 but we may as well bump to the latest stable version.

In Jetty 9 it appears the request is logged after the response is sent.
Thus it was racing with the assertions that check the client IP. So to
fix this rather stashing the 'lastRequest' we just make the server
echo the client's IP in a response header.

Some other minor tweaks were needed due to changes in Jetty behaviour:

- We stop checking the length of the raw response. It doesn't tell us
  anything and easily varies.

- Jetty now generates Set-Cookie with a space after the ;

- Jetty now lowercases the word "basic" in WWW-Authenticate header

- testLaxUrlEncoding(): Jetty now rejects bad paths with a 400 error so
  we disable the response checks. The actual request line is
  still checked which is the important thing.

Note: This patch does not affect the version of jetty used by the
Heritrix admin console. That will be tackled separately.
Jetty 9.4.12+ is required for TLS to work correctly under JDK11
(due to SSL handshake failures). In order to upgrade
Jetty we also need to upgrade Restlet.

There is one intentional change in behaviour to simplify
upgrading. We remove a workaround for an old [webkit bug]
where the browser claimed to prefer application/xml. The
bug was fixed in 2011.

[webkit bug]: https://bugs.webkit.org/show_bug.cgi?id=27267

Summary of Jetty API changes:
- package names changed such as org.mortbay -> org.eclipse
- SocketConnector and SslSocketConnector merged to ServerConnector
- HashUserRealm split into UserStore and HashLoginService
- SecurityHandler -> ConstraintSecurityHandler

Summary of Restlet API changes:
- some classes have moved package (Request, Response, Router etc)
- ServerResource replaces Resource
- represent(), acceptRepresentation() renamed to get(), post()
- constructors were replaced by an init() method
- setModifiable() was removed
- getRequest().getEntityAsForm() -> new Form(entity)
- Guard -> ChallengeAuthenticator

Fixes #275
Jetty 9.4 requires JDK 8 or later. JDK 11 requires Jetty 9.4.12+.
Therefore unfortunately we cannot easily support both JDK 11 and JDK 7
at the same time.
@nlevitt nlevitt merged commit cefad96 into master Aug 7, 2019
@ato ato deleted the jdk11-upgrade-jetty branch August 12, 2019 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants