J4 Issue ?
avatar ReLater
ReLater
2 Mar 2018

Steps to reproduce the issue

  • Installed a Let's Encrypt Certificate for a domain with settings:
    02-03-_2018_11-04-15
  • In Joomla configuration: Force HTTPS: Entire Site.
  • In a single menu item Secure: Off
  • Go to frontend and check the related menu link: As expected it's the only link that has a leading http: while all other links have a leading https:
  • Click this http-link.

==> Joomla redirects to a https page

  • Checked all HSTS entries in FF browser and deleted all (SiteSecurityServiceState.txt).
  • Checked redirects elsewhere, SEF Plugin, live_site. None.
  • Entered the http URL in address bar of browser => Redirection to https.
  • Checked if the browser is remembering the unwanted https page. No.

Additional comments

Makes no sense if only the menu link gets a http protocol.
URL Routing: Legacy
SEF: On with rewriting

Issue has been reported in German forum by HorstG https://forum.joomla.de/index.php/Thread/5152-SSL-bei-1und1-einzelne-Seiten-Zuweiseung-funktioniert-nicht/?postID=34222#post34222 and I could reproduce it.

avatar ReLater ReLater - open - 2 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - change - 2 Mar 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar ReLater ReLater - change - 2 Mar 2018
The description was changed
avatar ReLater ReLater - edited - 2 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Mar 2018
Category Plugins
avatar Twincarb
Twincarb - comment - 2 Mar 2018

This is the expected behaviour, the Super Admin decides to force https on the website he doesn't want a normal admin from overriding his decision.
Setting Force HTTPS: Entire Site Will force every page to be returned by the site as https


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19814.

avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Mar 2018
Status New Discussion
avatar ReLater
ReLater - comment - 2 Mar 2018

Then the setting Secure: Off in menu items is complete nonsense and should be removed completely if a Super User has made a global decision.

avatar brianteeman
brianteeman - comment - 2 Mar 2018

Or the reply was incorrect

avatar ggppdk
ggppdk - comment - 3 Mar 2018

1. Per menu item setting ('secure' parameter)

is used inside helper of mod_menu
to create a link that has https or http as protocol

https://github.com/joomla/joomla-cms/blob/staging/modules/mod_menu/helper.php#L127

$item->flink = JRoute::_($item->flink, true, $item->params->get('secure'));

2. Global forcing of https ('force_ssl' parameter)

happens at the start of --current page-- URL parsing inside SiteRouter.php inside the parse() method

There, before the URL is "parsed" by Joomla routing and thus before its itemId (and other variables) are discovered, the redirection to HTTPS is forced only by looking at current protocol
(thus it does not examine any menu item settings)

https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Router/SiteRouter.php#L80-L85

if ($this->app->get('force_ssl') == 2 && strtolower($uri->getScheme()) !== 'https')
{
	// Forward to https
	$uri->setScheme('https');
	$this->app->redirect((string) $uri, 301);
}

further down the code the URI is parsed to get variables and thus also get itemId for the current page

https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Router/SiteRouter.php#L138-L140

$vars += parent::parse($uri);

return $vars;

Probably change description of menu item parameter,
to document that the setting is used only when force HTTPS is not enabled in global configuration

avatar ReLater
ReLater - comment - 3 Mar 2018

The setting in menu items and "expected bahavior" is completely misleading and unhandy for """normal""" users; also concerning SEO and ""DC"".

  • Set Force HTTPS: OFF in configuration.
  • For a single menu item set: Secure: On but not for home page
  • Visit frontpage/home page
  • The link of above menu item has https,. All others have http. Fine.
  • Click the https link.
  • On https page all links have a https now except menu items where you set explicitly Secure: Off. Fine (somehow)
  • Now change the URL in address bar of browser to http instead of https. No redirect. You'll see the http page.

I think this needs more than just an endless description. I understood the current one after my finds and code view. It talks about "links".

After looking at the codes:
Maybe an early plugin would be a good place in the future ("force SSL of menu items by redirect if Secure is ON" or something) to make this feature more understandable and/or consistent. Even if it will reduce performance because it has to check the menu params if it shall redirect ( (EDIT: or manipulate the $app configuration) or not, it would be less confusing and it would be a user decision

avatar brianteeman
brianteeman - comment - 3 Mar 2018

I am still at a complete loss as to why you would ever want to turn off SSL for any part of your site.

avatar ReLater
ReLater - comment - 3 Mar 2018

In this case a user wanted to disable it because of IFrames on the page that are only available via http.

I am still at a complete loss as to why you would ever want to turn off SSL for any part of your site.

I myself agree. But then my decision would be to remove this misleading setting from menu items. Maybe in Joomla 4 even if it would be a drastic B\C break. But consequent.

avatar ReLater
ReLater - comment - 3 Mar 2018

I opened this issue because it's a recurrent issue for users, not only in forums.

avatar tonypartridge
tonypartridge - comment - 4 Mar 2018

We can’t remove it due to BC since some components may use it and cause a redirect.

The issue is you are trying to include insecure I framed. The provider of the iframes / content should upgrade their site to SSL it’s quick and easy and mainly free these days! And problem is solved.

The web is going full https and to go backwards to https seems like a crazy step.

I would suggest should you progress down this route to use htaccess rules to setup your unique redirect scenario.

avatar ReLater
ReLater - comment - 5 Mar 2018

We can’t remove it due to BC since some components may use it and cause a redirect.

I don't understand. We can't remove a nonsense feature from Joomla 4 core? There is no core extension that is using this setting in a consequent way! There's exactly 1 place where Joomla redirects to SSL (when SSL is activated in configuration).

And there are other settings that were removed from Joomla 4 that could be theoretically used in extensions.

Your answer contradicts itself. On the one hand you want to force users to use SSL. On the other you want to keep this stupid setting.

It's easy for any programmer that is able to code a component to code a plugin, too, that brings back this setting in menus! 10 lines of code.

Describe a scenario please where this feature makes any sense in Joomla core!!

The issue is you are trying to include insecure I framed. The provider of the iframes / content should upgrade their site to SSL

As I've said above I personally try nothing.

I don't want a discussion here about things that others should do because you mean that they should do it or could do it. You also forget that SSL certificates are still not free at all hosters. And that some sites don't need SSL at all.

Be consequent! Remove it!

avatar brianteeman
brianteeman - comment - 5 Mar 2018

Yes it can be removed in J4. Tony was referring to J3

From July chrome will label any page without SSL as insecure.

avatar brianteeman
brianteeman - comment - 5 Mar 2018

Thinking about it i seem to recall that if the site is forced to on then you cannot force an individual item to off. The setting is only relevant if you want to switch an individual item to on when the site is not forced to on.

avatar tonypartridge
tonypartridge - comment - 5 Mar 2018

Yep which is why he wants ‘off’ removed as a selection ?

On 5 Mar 2018, 14:58 +0000, Brian Teeman notifications@github.com, wrote:

Thinking about it i seem to recall that if the site is forced to on then you cannot force an individual item to off. The setting is only relevant if you want to switch an individual item to on when the site is not forced to on.

You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar ReLater ReLater - change - 6 Mar 2018
Title
Deactivate SSL for single menu item fails
[4.0] Deactivate/Remove SSL setting of menu items
avatar ReLater ReLater - edited - 6 Mar 2018
avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar ReLater ReLater - change - 4 Apr 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-04-04 21:59:33
Closed_By ReLater
avatar ReLater ReLater - close - 4 Apr 2018

Add a Comment

Login with GitHub to post a comment