Forum: Typo SSL support in Typo

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
069a6c0e9ddab2265996593a9fc436d9?d=identicon&s=25 Pramit Roy (pramitroy)
on 2012-07-05 18:41
I have added SSL support to WEBRick for Typo, the problem is that, URL
to any new page is not having "https", rest are still OK. I did not go
through the code of typo much, where can it be changed from?
8f6b8e99f52f0928287b01a006950f52?d=identicon&s=25 Matijs van Zuijlen (mvz)
on 2012-07-05 19:36
(Received via mailing list)
Hi,

On 05/07/12 18:41, Pramit Roy wrote:
> I have added SSL support to WEBRick for Typo, the problem is that, URL
> to any new page is not having "https", rest are still OK. I did not go
> through the code of typo much, where can it be changed from?

Can you provide some more details? What did you change? Where do the
incorrect
URLs appear? Is it possible to access the new page with https by typing
it in
the address bar?

As far as I know, there is only one place where the protocol part of the
URIs is
configured: In the base url setting for the blog. Therefore, it's odd
that http:
should still appear once you have changed that.

Regards,
069a6c0e9ddab2265996593a9fc436d9?d=identicon&s=25 Pramit Roy (pramitroy)
on 2012-07-05 19:58
Hey Matijs,

Thank you very much for your quick reply. Yes, it possible to access the
new page with https by typing it in the address bar.

I have not changed any base URL setting from the blog code or config.
All I did is to add a default_options for Rack server by adding a module
in script/rails. After that I can access the blog site by putting
https:. Now I have also noticed that for few links (like Home, RSS etc)
the URL is being retrieved from DB (from blog table) which was also not
being changed automatically before I changed it from DB.

Now most of the links that I have checked are OK (coming with https)
only problem is with "Page" section where any page is having "http:" in
its URL.

So now my question is, could you please let me know where can I change
base URL from typo code?
Hopefully that is still adding http and others are using relative path
so getting https (just a theory).
069a6c0e9ddab2265996593a9fc436d9?d=identicon&s=25 Pramit Roy (pramitroy)
on 2012-07-06 08:05
I can see from application controller that it gets the base URL from
page address which is working fine when I have https in URL. In one case
it gets this_blog.base_url which is retrieved from DB and that was set
during the setup process. As it was http while setting up it had http as
the value. But I fixed that also. The only one thing remaining is from
navigation bar where I have page links printed as
"http://../page/page-permalink". I am sure this is being set apart from
base_url value in controller or blog_base_url value from DB. So could
anyone direct me where from the URLs for "page" in Typo are being
generated?

Here is an example blog for you to check

https://pramit.info:3333/

You can see from nav bar below header image that both "Home" and
"Articles" have HTTPS, only "About" page is having HTTP. Which is the
same in admin panel also. That does not work by creating redirect rule
from inside Typo.
069a6c0e9ddab2265996593a9fc436d9?d=identicon&s=25 Pramit Roy (pramitroy)
on 2012-07-06 12:10
Figured out the problem.

url_for() returns http URL unless specified with protocol
8f6b8e99f52f0928287b01a006950f52?d=identicon&s=25 Matijs van Zuijlen (mvz)
on 2012-07-08 13:54
(Received via mailing list)
On 06/07/12 12:10, Pramit Roy wrote:
> Figured out the problem.
>
> url_for() returns http URL unless specified with protocol

If you can prepare a patch to fix this, I'd be interested.
069a6c0e9ddab2265996593a9fc436d9?d=identicon&s=25 Pramit Roy (pramitroy)
on 2012-07-11 05:00
Sure, will do..
Thanks for your help.
This topic is locked and can not be replied to.