Fork me on GitHub

Is it possible to get a jetty-based server using wrap-ssl-redirect to redirect http requests to https and employ dynamically assigned ports? There is a chicken-and-egg problem in that the handler (including the middleware) must be provided to create the server, but the port is not known until after the server starts.


Jetty itself (as of version 9) appears to get around this problem by injecting a sort of middleware (the SecuredRedirectHandler) that has access to the resolved ssl port in the HttpConfiguration.