Redirecting to HTTPS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Redirecting to HTTPS

brandon
So I'm new to Ratpack, just got my server configured with an SSLContext, and it's working over https, which is great.

When I try to load a page over HTTP instead of HTTPS, however, I get ERR_EMPTY_RESPONSE in the browser and io.netty.handler.ssl.NotSslRecordException in the logs. Makes sense, really...

But I would sure love to do some sort of protocol redirect. My sense is that most sites do this sanely. Specifically, when I deploy to Heroku, I want to make sure that this all works for less-than-brilliant users.

I suspect that StartTLS may be one way to go (just found that today), but it seems Ratpack is currently not configured to make use of this; specifically, Ratpack never calls one of the SslHandler constructors that take the "startTls" boolean.