You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Carsten Ziegeler <cz...@apache.org> on 2022/12/22 09:56:58 UTC

Re: HTTP and HTTPS on same Jetty port (with possible redirect)

Hi Rob,

sorry for the late response, the way you suggest implementing it sounds 
ok to me; however I'm really wondering how often such a feature is used 
as https by default uses port 443, so in many cases you would redirect 
http on port 80 to https on port 443.

Regards
Carsten

Am 29.11.2022 um 20:56 schrieb Rob Walker:
> Wonder if anyone has done work in this are on Felix HTTP. Looks like 
> since Jetty 9.4 it’s possible to use a DetectorConnectionFactory to 
> serve HTTP and HTTPS on a common port:
> 
> https://stackoverflow.com/questions/65568213/redirect-http-to-https-on-the-same-port-with-jetty-identifying-http-vs-http <https://stackoverflow.com/questions/65568213/redirect-http-to-https-on-the-same-port-with-jetty-identifying-http-vs-http>
> 
> Primary use (in our case) would be an auto redirect of HTTP to HTTPS, 
> but I guess others may find it useful just to allow both protocols.
> 
> Happy to dig into the JettyService code and have a go at this if no one 
> else has and there’s no alternative approaches.
> 
> The basics should be possible with existing config options e.g. if both 
> HTTP and HTTPS are configured and the port is the same, use a 
> DetectorConnectionFactory approach. If not, operate as current.
> 
> The redirect part can be done in user servlet or context handling code 
> (at least initially). Although with agreement on approach and config, it 
> should be possible to support that as a configurable option too.
> 
> ---
> 
> Rob Walker
> 
> www.ascert.com <http://www.ascert.com/>
> 

-- 
Carsten Ziegeler
Adobe
cziegeler@apache.org