1

I have trouble enabling ssl for my application.

I tried various gems/solutions and none of them work. Here is the list:

I've made sure I removed all the code from my previous attempt.

What do I want

I want the whole (Rails3) application to run trough SSL/HTTPS. I've read a number of articles that explain this and tried various solutions (see above).

So what is the problem:

Currently I use the rails 3 bartt/ssl_requirement gem and the problem is that some of the url's go to a [http://example.com:443 page]. Which result in an page-removed-error. At the same time other url's are fine and go to [https://example.com] and they work. These url's which i'm talking about are all from within the same controller which is ssl_forced/ssl_required/whatever. I even tried to contraint all the routes with :protocol => 'https', but that resulted in endless-redirects.

I use the bartt/ssl_required atm because the url's don't result in endless-redirect-errors, which I got with some other gems/solutions.

I don't get it... I understand that every encrypted-url goes trough the port 443, but I don't recall seeing any http/https url's with the port straight in it.

What causes this strange url behavior within the same controller? Is it because some are named-routes? How do I :constraint them then, because I fail to get this thing working.

Community
  • 1
  • 1
grub4r
  • 133
  • 1
  • 7

1 Answers1

0

I found the solution.

My ssl-settings were correct, but I used the wrong helper for my links. I used the _url-helper method and what it should've been is the _path-helper.

That solved the http://example.com:443 url to https://example.com. It seems that the url-helper rewrites the whole url in some way. (must be something like that)

Hooray for patience.

grub4r
  • 133
  • 1
  • 7