SSL with Rails
collectiveidea.com
collectiveidea.com
In the spirit of creating wealth through exchange:
https://gist.github.com/721114
A frequent problem I have is using CSS files which include http:// linked background images, which will pass through every test with flying colors and then trigger prominent mixed-content security warnings in a browser I very seldom use. Slap this code in your initializers directory and you never have to worry about it again.
Just write your stylesheet_link_tag as normal, and then include :cache => request.ssl? ? "foo-secure" : "foo-standard"
Bonus: the included code also minimizes CSS and JS files in production, saving you page load time.
For those who missed it, apparently this works across browser to avoid mixed content warnings:
<script src="//ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js" type="text/javascript"></script>
Thanks for the detail.
It doesn't have to be Ruby, especially if I won't be programming for it anyway.
This is an additional (draft status) header that tells the user agent to always (or up to X seconds in the future) use HTTPS for that site and it seems, to disallow any connections using bad certificates.
Currently only Chrome and latest dev version of Firefox seem to support it. Chrome apparently has a pre-loaded list of always-https domains, like www.paypal.com -- who are also the people behind this draft proposal.
Am I right in thinking that if third party embeds/widgets dont answer at an https url, I am stuck with mixed content warnings?
Yeah, you profoundly do not want open proxies.