I'm using Rack via Sinatra and Thin, serving HTTPS on port 44567. That works, but I'm not able to set up automated transfers from HTTP to HTTPS. I'm trying to use the rack-ssl gem to force this, but not seeing any effect.
I assume that I'm simply calling it wrong. Might anyone have suggestions?
FWIW, here's a Gist that documents and demonstrates the issue:
https://gist.github.com/RichMorin/62d5594237e487242f027ca51cafa290
-r
--
---
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is a web server issue, not a rack issue. Most webservers will not let you serve plaintext and TLS over the same port. When I say most, I mean I don't know of any ruby webservers that support this, as all of them rely on openssl listen sockets for TLS.
On Saturday, December 17, 2016 at 5:08:12 PM UTC-8, raggi wrote:This is a web server issue, not a rack issue. Most webservers will not let you serve plaintext and TLS over the same port. When I say most, I mean I don't know of any ruby webservers that support this, as all of them rely on openssl listen sockets for TLS.Hmmm. A lot of web servers I've encountered force a switch from HTTP to HTTPS, but then, they're also switching from port 80 to port 443.
I suppose that I could redirect requests from (say) http://<IP>:34567/... to https://<IP>:44567/..., but I'm not sure how useful that would be. Also, not exactly sure how to do this.Any other suggestions, anyone?
On a related note, the Rack::SSL page (https://github.com/josh/rack-ssl) says that it "Redirects all 'http' requests to 'https'". However, it says nothing about port numbers and offers no options that I can see in this area. I'd like to understand the exact behavior I should expect from it and whether there are any ways to play with port numbers, etc.