Page MenuHomePhabricator

Mobile view link unexpectedly goes to HTTPS
Closed, ResolvedPublic

Description

Author: grant

Description:
clicking on the mobile line from a desktop pc
firefox 27

Secure Connection Failed

An error occurred during a connection to www.idahothewhitewaterstate.com. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

chrome
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error code: ERR_SSL_PROTOCOL_ERROR

works fine on the android


Version: unspecified
Severity: normal
OS: Windows 7
Platform: PC
Whiteboard: aklapper-moreinfo

Details

Reference
bz61358

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:53 AM
bzimport set Reference to bz61358.
bzimport added a subscriber: Unknown Object (MLST).

grant wrote:

the problem is the link is: https: rather than: http.

What is your MobileFrontend - related configuration?

Hi grant,
unfortunately this report is not very useful because it does not describe the problem well. If you have time and can still reproduce the problem, please read https://www.mediawiki.org/wiki/How_to_report_a_bug and add a more useful description to this report.
What exactly is a "mobile link on a desktop pc"?

How is this related to Wikimedia / Wikipedia?

grant wrote:

This isn't related in anyway to wikimedia or wikipedia. It is related to MediaWiki. MobileFrontend is a mediawiki extension and the bug reporting link on the extension page --
http://www.mediawiki.org/wiki/Extension:MobileFrontend
directs to here, to bugzilla. If I am in the wrong place, perhaps that link should be removed.

Let me know if I should continue.

Please provide steps to reproduce the problem, so another person could follow your steps and would end up woith the same result.

Andre, the report is clear enough for me the MF developer.

grant, please tell me your configuration.

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1705

grant wrote:

$wgServer = "http://wiki.kayakidaho.com";

MobileFrontend

require_once DIR . "/extensions/MobileFrontend/MobileFrontend.php";
$wgMFAutodetectMobileView = true;

pretty basic. I placed a couple mobile divs on the home page and a template.

I tried a couple .htaccess rewrites without success.
I have to qualify my comment: "works fine on android."
The template works fine. It will switch back to desktop with the link at the footer. It will not switch back to mobile.

Grant, it might be useful to see your whole LocalSettings.php file (with sensitive info like passwords, etc redacted). At the very least - do you have $wgSecureLogin set?

grant wrote:

if it's a mess excuse me.


if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}

$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) );

#$wgCanonicalServer = 'http://wiki.x.com';
#require_once( "includes/DefaultSettings.php" );

$wgSitename = "Idx ww";
$wgMetaNamespace = "Idx_ww";

$wgServer = "http://wiki.x.com";

$wgScriptPath = ""; # not edited. that is how it appears tuf to figure paths for subdomain.
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";
$wgArticlePath = "$wgScript?title=$1";
$wgStylePath = "$IP/skins";
$wgStyleDirectory = "skins";
$wgLogo = "images/bookthumb.jpg";
$wgSecureLogin = false;
$wgEnableEmail = true;
$wgEnableUserEmail = false;

$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

Experimental charset support for MySQL 4.1/5.0.

$wgDBmysql5 = false;

Shared memory settings

$wgEnableParserCache = false;
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

  1. To enable image uploads, make sure the 'images' directory
  2. is writable, then set this to true:

$wgTmpDirectory = true;
$wgEnableUploads = true;
$wgFileExtensions = array('png','gif','jpg','jpeg','xls','pdf','tiff','bmp','kml');
$wgUseImageResize = true;
$wgUseImageMagick = true;

$wgImageMagickConvertCommand = "/usr/bin/convert";

image majik thumb fix sept 10

$wgCustomConvertCommand = "/usr/bin/convert -resize %wx%h %s %d";
$wgImageMagickTempDir = "$IP/x/tmp";
$wgTmpDirectory = "$IP/x/tmp";
$wgLanguageCode = "en";
$wgProxyKey = "xx";
$wgDefaultSkin = 'monobook';
$wgEnableCreativeCommonsRdf = true;
$wgRightsPage = "Copyright";

$wgDiff3 = "/usr/bin/diff3";

$configdate = gmdate( 'YmdHis', @filemtime( FILE ) );
$wgWhitelistRead = array( "Main Page", "Special:Userlogin", "Help:Contents", "Idaho Whitewater:Privacy policy", "Idaho_Whitewater:About", "Special:Contact", "Payette,_Middle_Fork,_Silver_Creek");
$wgGroupPermissions['*' ]['edit'] = false;
$wgGroupPermissions['*' ]['read'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = true;

extensions start here

enableSemantics( 'wiki.x.com');

Namespace config SMW

$smwgNamespace = 'http://wiki.x.com';

Semantic Maps

require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );

installer

require_once "$IP/extensions/ExtensionInstaller/ExtensionInstaller.php";
// Category Tree
#$wgUseAjax = true;
require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
#forms
include_once( "$IP/extensions/SemanticForms/SemanticForms.php" );
$wgAllowExternalImages = true;

mobile frontend

#require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";
require_once DIR . "/extensions/MobileFrontend/MobileFrontend.php";
$wgMFAutodetectMobileView = true;

ajax poll

require_once DIR . "/extensions/AJAXPoll/AJAXPoll.php";
$wgGroupPermissions['user']['ajaxpoll-view-results'] = true;
#contactpage
require_once( "$IP/extensions/ContactPage/ContactPage.php" );
$wgContactUser = 'me';
$wgContactSender = $wgPasswordSender;
$wgContactSenderName = 'Contact Form on ' . $wgSitename;

#confirm edit
require_once "$IP/extensions/ConfirmEdit/ReCaptcha.php";
$wgCaptchaClass = 'ReCaptcha';
$wgReCaptchaPublicKey = 'x';
$wgReCaptchaPrivateKey = 'x';
#turn on captcha on the contact
$wgCaptchaTriggers['contactpage'] = true;

Grant, I don't see anything that suggests the problem is Mediawiki or MobileFrontend related and I can't replicate your problem. The error your described in your original post suggests to me that you may be dealing with a server configuration issue, though I really can't be sure.

Is the site in question publicly visible? It may be easier for us to have a better sense of what is happening if we can see the issue in the wild.

grant wrote:

I'm in the middle of a server change. Give me a day or two. Since is is a subdoman of a different site, I wonder if the htaccess of the other site is passing along some values. I will get back to you once I'm up and running.

(In reply to grant from comment #13)

I'm in the middle of a server change. Give me a day or two.

Grant: Any news?

morbus wrote:

I'm seeing this too. Still debugging. Public URL: http://www.disobey.com/wiki/Main_Page

morbus wrote:

Fact dump:

  • Old wiki, updated a number of times.
  • No core hacks or patches.
  • Never configured for https:.
  • Brand new install of MobileFrontend.
  • Vanilla enabled - no additional config past $wgMFAutodetectMobileView.
  • Running today-pulled REL1_22 of both core and MobileFrontend.
  • $wgSecureLogin is not set.

The cause is in MobileContext::getMobileUrl( $url, $forceHttps = false ), namely that second argument. In the code, if that evaluates to TRUE, then the scheme is set to https - the expectation for that argument is a boolean. But, if you look in onSkinTemplateOutputPageBeforeExec(), you'll see that $args, an array, is being passed to it. In my case, $wgMobileUrlTemplate wasn't configured, so $args will always be an array filled with the mobileaction => toggle_view_mobile.

morbus wrote:

Patch to change $args to $wgMFForceSecureLogin

Patch attached. I'm not a MW developer, so I've likely screwed up the proper workflow somewhere, but this is what's now running on disobey.com/wiki/, and is consistent with other uses of getMobileUrl() with the second argument.

Attached:

@Morbus: Can you use Gerrit patch uploader instead? :)
https://tools.wmflabs.org/gerrit-patch-uploader/

For this tool you only need a free MediaWiki account :)

@Morbus: Sorry, but: https://gerrit.wikimedia.org/r/#/c/91123/
:) In actual version of MobileFrontend getMobileUrl is called with only one argument, so all ok, no need for a patch? Can you try to update MobileFrontend and test?

morbus wrote:

@Florian: Confused. I grabed REL1_22 from git, per http://www.mediawiki.org/wiki/Extension:MobileFrontend - I pull all my extensions and MW core from git vs. using the packaged downloads. Even so, the commit isn't in the snapshot download either. It doesn't look like this patch has been applied to REL1_22 at all - should it have been?

https://git.wikimedia.org/log/mediawiki%2Fextensions%2FMobileFrontend.git/refs%2Fheads%2FREL1_22

morbus wrote:

Incidentally, I can't use master, as there's a version checker in it which states it requires MW 1.23.

Change 137291 had a related patch set uploaded by Florianschmidtwelzow:
Fix incorrect value being passed in second argument of MobileContext::getMobileUrl()

https://gerrit.wikimedia.org/r/137291

Yeah, you are right, the patch isn't backported to REL1_22.

Change 137291 merged by MaxSem:
Fix incorrect value being passed in second argument of MobileContext::getMobileUrl()

https://gerrit.wikimedia.org/r/137291