Projet

Général

Profil

Anomalie #1621

Mis à jour par theo _ il y a plus de 9 ans

Lorsque l'on affiche le wiki en http, l'affichage est correct, mais il est dégradé en https.

Les navigateurs évolués bloquent les contenus actifs mixtes.

Voilà ce que l'on voit sous Firefox.

<pre>
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.monobook&only=styles&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=site&only=styles&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=startup&only=scripts&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=site&only=scripts&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.monobook&only=styles&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=site&only=styles&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=startup&only=scripts&skin=monobook&*"
> Blocked loading mixed active content "http://wiki.april.org/load.php?debug=false&lang=fr&modules=site&only=scripts&skin=monobook&*"
</pre>


Le comportement n'est pas observable avec un aspirateur de page (même avec un user agent Firefox).

<pre>
> $ diff <(wget -qO - http://wiki.april.org) <(wget -U "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20140924 Firefox/24.0 Iceweasel/24.8.1" -qO - http://wiki.april.org )
> 233c233
> < <!-- Served in 0.419 secs. --></body></html>
> \ No newline at end of file
> ---
> > <!-- Served in 0.408 secs. --></body></html>
> \ No newline at end of file
</pre>


La solution est de setter la variable $wgServer pour éviter que les pages soient par défaut servies en http, même quand on est en https.

<pre>
> # git show --color cae205b -- /etc/mediawiki/LocalSettings.php
> commit cae205b3bd5302fa122ff49daced8511fd9fd423
> Author: theo <theo@april.org>
> Date: Thu Oct 16 18:02:44 2014 +0200


>
>
Setting $wgServer to fix https "mixed active content" issues


>
>
diff --git a/mediawiki/LocalSettings.php b/mediawiki/LocalSettings.php
> index 5497eff..6432351 100644
> --- a/mediawiki/LocalSettings.php
> +++ b/mediawiki/LocalSettings.php
> @@ -30,6 +30,13 @@ require_once( "$IP/includes/DefaultSettings.php" );
> $path = array( $IP, "$IP/includes", "$IP/languages" );
> set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );


>
>
+# theo 2014-10-16
> +# Avoid https issues. Browser will display "Blocked loading mixed active
> +# content" because the https page tried to do http calls. Setting
> +# $wgServer to // instead http:// will allow the browser to use the
> +# current mode (http or https)
> +$wgServer = '//wiki.april.org';
> +
> # Frederic Couchet - 20081029 - pour que l'heure corresponde a celle du serveur
> $wgLocaltimezone = 'Europe/Paris';
> $oldtz = getenv("TZ");
</pre>

Retour