You have to use a proxy that handles SSL for you, something like
apache, lighttpd,
nginx, or pound should work, neither Rack nor Ramaze/Innate handle this.
You could also try using WEBrick, it also has limited SSL support AFAIK.
--
Michael Fellinger
CTO, The Rubyists, LLC
Just remember to then use raw_redirect in all your own code and not
redirect otherwise all your links will break.
Clive
I, of course, meant "redirects", not "links".
Clive
I have now put the app behind a proxy. I am a bit puzzled that the
https port is 443, but my application listens on port 7000
So when I do a https request to ramaze, I need to have a redirect_raw
in the action is that right? Where would I redirect to?
Sorry, perhaps my short statement added to the confusion and was
perhaps unintentionally misleading. Only if you are ever using
"redirect" within any action use "raw_redirect" instead. You don't
*need* either. Only if you are already using redirects, for example
after a form post.
Clive
This is done in apache. Ramaze is ignorant of the final connection
type shown to the end-user.
> 2. My action will receive the post and use raw_redirect to another
> action under Https?
Generally this is normal web practice. If you receive a POST you
process it, then redirect to another page to show the result, be it
"success" or "failure" or "whatever".
When (if) you ever use a redirect within your own code then make use
of raw_redirect rather than redirect. The reason I mention this is
because the "redirect" method in ramaze does some magic of it's own,
more so than "raw_redirect". Using the type of setup you have in mind
where a third party server (in this case apache) handles the SSL and
proxies to Ramaze (not running in SSL mode) when you use "redirect"
inside your own source code Ramaze detects that it itself is not in
SSL mode and will change the URIs generated in raw_redirect from https
to http every time you use "redirect". So ... to avoid that use
"raw_redirect" so that Ramaze does not attempt to "fix" what it thinks
is incorrect.
Clive
Hi Clive,
I am using apche web server up front, with mod proxy enabled.
For clarity with regard to redirect vs raw_redirect:
Regardless of mechanisms to cater for http and https simultaneously
using "redirect" rather than "raw_redirect" will cause redirects to
unexpectedly switch to http even when you explicitly expect it not to
do so. In fact, enabling http is possibly more dangerous in this
situation as you would then enable all pages to work with http even
those meant to be secure only.
Clive
if the incoming connection from Apache/nginx/lighttpd/whatever is SSL
then ramaze works fine.
The problem is that most setups do this:
browser <--SSL--> proxy <--NONSSL--> ramaze
so as far as ramaze is concerned it's "not SSL".
Just be aware of your environment.
Also you don't need to specify "http://.." or "https://" within raw_redirect
simply doing:
raw_redirect( r( :action ) )
works fine in all conditions whether you're using http or https
Clive
--Nick