Detection of HTTPS connections

Contents...

Webasyst framework detectes HTTPS connections to server by means of method waRequest::isHttps(). This method takes the values of $_SERVER variables into account.

If a server returns an unusual array of variables or their values, then the framework may fail to correctly detect HTTPS connections. That will affect generation of absolute link URLs and the functioning of redirects.

If you cannot change your web server configuration to match the logic of method waRequest::isHttps(), then you can configure Webasyst to correctly read your server variable values. To do so, edit file wa-config/SystemConfig.class.php by adding to its class SystemConfig public method init() as shown in the example below.

class SystemConfig extends waSystemConfig
{
    public function init()
    {
        // Mandatory call of parent class method!
        parent::init();
    
        // Describe the HTTPS connection detection logic
        $https_condition = /* ... */;
        
        if ($https_condition) {
            // When variable 'HTTP_X_HTTPS' is set to true,
            // framework "understands" that it is an HTTPS connection.
            // See method waRequest::isHttps().
            $_SERVER['HTTP_X_HTTPS'] = true;
        }
    }
}