See https://tools.wmflabs.org/liangent-php/detectProtocol.php/enwiki
Feel free to move this bug to MediaWiki product if there's some reliable way to check so there while MediaWiki is unaware of it.
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=64627