SimpleSAML\Utils\HTTP::getServerHTTPS PHP Method

getServerHTTPS() private static method

Retrieve HTTPS status from $_SERVER environment variables.
Author: Olav Morken, UNINETT AS ([email protected])
private static getServerHTTPS ( ) : boolean
return boolean True if the request was performed through HTTPS, false otherwise.
    private static function getServerHTTPS()
    {
        if (!array_key_exists('HTTPS', $_SERVER)) {
            // not an https-request
            return false;
        }
        if ($_SERVER['HTTPS'] === 'off') {
            // IIS with HTTPS off
            return false;
        }
        // otherwise, HTTPS will be a non-empty string
        return $_SERVER['HTTPS'] !== '';
    }