Community
Participate
Working Groups
When running a servlet from inside the nested connector the method HttpServletRequest#isSecure() always returns false.
The suggested patch consists of doing what the SslChannelSelectConnector does: Override the method isConfidential in the NestedConnector. /** * In the case of the NesteConnector it is not clear that we can check the forwarded attribute. * We do something similar to what the Ssl*Connector does. * @see org.eclipse.jetty.server.Connector#isConfidential(org.eclipse.jetty.server.Request) * @see org.eclipse.jetty.server.ssl.SslSelectChannelConnector#isConfidential(org.eclipse.jetty.server.Request) */ public boolean isConfidential(Request request) { if (request.getScheme().equalsIgnoreCase(HttpSchemes.HTTPS)) { final int confidentialPort = getConfidentialPort(); return confidentialPort == 0 || confidentialPort == request.getServerPort(); } else { return false; } }
the connector is now setup in forwarded mode and inspects for the x-forwarded-for headers. Also the outer request is consulted when setting the protocol.