MediaWiki supports mixed-protocol HTTP/HTTPS operation, although as of 2020 it's being phased out, in accordance with generic web best practices which suggest making sites HTTPS-only. HTTP communication happens in cleartext, can be eavesdropped on, passwords and user sessions can be stolen, or the user can be hijacked to a fake site via man-in-the-middle attacks. HTTPS communication is encrypted, and the browser cryptographically verifies the server's identity.
Running a HTTPS-only wiki[edit]$wgForceHTTPS
to true
; this will redirect all HTTP requests to HTTPS, and set the secure
flag on all cookies.X-Forwarded-Proto: https
should be set on such requests to suppress the redirect. You might also need to set $wgInternalServer
, for the benefit of extensions which cause MediaWiki make web requests to itself.A mixed-protocol wiki can be accessed via both HTTP and HTTPS. This is inherently insecure, as HTTP connections can be monitored by third parties, who track what your users do, or steal authentication cookies and temporarily take over user accounts. You will need to set $wgServer
to a protocol-relative URL and set $wgCanonicalServer
to an absolute URL (up to you whether it is the HTTP or HTTPS one).
$wgSecureLogin
, MediaWiki will do its best in this scenario to protect passwords, at least, by forcing users to HTTPS for the duration of their login. Users will be able to set in their preferences (prefershttps
user preference) and during login that they prefer HTTPS, in which case they get automatically redirected as if $wgForceHTTPS
were enabled.X-Forwarded-Proto: https
should be set on such requests to suppress the redirect.This requires no extra configuration, but is strongly recommended against as it is even more insecure than a mixed-protocol wiki.
Other relevant hooks and configuration settings[edit]$wgCookieSecure
- for forcing cookies to be HTTPS-only. There shouldn't be any need to change the default value.$wgVaryOnXFP
- for setting the appropriate Vary header; might be needed for proxies/CDNs.$wgHttpsPort
- for using a non-standard HTTP port.https
role.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4