48         $this->ilias_ini = $DIC->iliasIni();
    49         $this->client_ini = $DIC->clientIni();
    51         if ($this->enabled = (
bool) $this->ilias_ini->readVariable(
    52             self::SETTINGS_GROUP_HTTPS,
    59         if ($this->automatic_detection = (
bool) $this->ilias_ini->readVariable(
    60             self::SETTINGS_GROUP_HTTPS,
    61             self::SETTING_AUTO_HTTPS_DETECT_ENABLED
    63             $this->header_name = $this->ilias_ini->readVariable(
    64                 self::SETTINGS_GROUP_HTTPS,
    65                 self::SETTING_AUTO_HTTPS_DETECT_HEADER_NAME
    67             $this->header_value = $this->ilias_ini->readVariable(
    68                 self::SETTINGS_GROUP_HTTPS,
    69                 self::SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE
    76         $this->protected_scripts[] = 
'login.php';
    77         $this->protected_scripts[] = 
'index.php';
    78         $this->protected_scripts[] = 
'register.php';
    79         $this->protected_scripts[] = 
'webdav.php';
    80         $this->protected_scripts[] = 
'shib_login.php';
    94         if ($this->automatic_detection) {
    95             $header_name = 
"HTTP_" . str_replace(
"-", 
"_", strtoupper($this->header_name));
    99                 if (strcasecmp(
$_SERVER[$header_name], $this->header_value) === 0) {
   111         $this->protected_classes[] = 
'ilstartupgui';
   112         $this->protected_classes[] = 
'ilaccountregistrationgui';
   113         $this->protected_classes[] = 
'ilpersonalsettingsgui';
   118         if (($sp = fsockopen(
$_SERVER[
"SERVER_NAME"], $port, $errno, $error)) === 
false) {
   127         $secure_disabled = (bool) $this->client_ini->readVariable(
'session', 
'disable_secure_cookies');
   128         if (!$secure_disabled && !$this->enabled && $this->
isDetected() && !session_id()) {
   129             if (!defined(
'IL_COOKIE_SECURE')) {
   130                 define(
'IL_COOKIE_SECURE', 
true);
   133             session_set_cookie_params([
   134                 'lifetime' => IL_COOKIE_EXPIRE,
   136                 'domain' => IL_COOKIE_DOMAIN,
   137                 'secure' => IL_COOKIE_SECURE,
   139                 'samesite' => (strtolower(session_get_cookie_params()[
'samesite'] ?? 
'')) === 
'strict' ? session_get_cookie_params()[
'samesite'] : 
'Lax'   147         if ($this->enabled) {
   162         switch ($to_protocol) {
   163             case self::PROTOCOL_HTTP:
   165                     !in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) &&
   166                     !in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
   169             case self::PROTOCOL_HTTPS:
   171                     in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) ||
   172                     in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
 const SETTINGS_GROUP_HTTPS
 
const SETTING_AUTO_HTTPS_DETECT_HEADER_NAME
 
bool $automatic_detection
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE
 
checkProtocolAndRedirectIfNeeded()
 
isDetected()
check if https is detected 
 
const SETTINGS_GROUP_SERVER
 
checkHTTPS(int $port=443)
 
const SETTING_AUTO_HTTPS_DETECT_ENABLED
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
shouldSwitchProtocol($to_protocol)