roundcubemail/program/lib/Roundcube/rcube_utils.php
public static function https_check($port=null, $use_https=true)
    {
        if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') {
            return true;
        }
        if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
            && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'
            && in_array($_SERVER['REMOTE_ADDR'], rcube::get_instance()->config->get('proxy_whitelist', array()))
        ) {
            return true;
        }
        if ($port && $_SERVER['SERVER_PORT'] == $port) {
            return true;
        }
        if ($use_https && rcube::get_instance()->config->get('use_https')) {
            return true;
        }

        return false;
    }
public static function https_check($port=null, $use_https=true)
    {
        if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') {
            return true;
        }
        if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
            && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'
            && in_array($_SERVER['REMOTE_ADDR'], rcube::get_instance()->config->get('proxy_whitelist', array()))
        ) {
            return true;
        }
        if ($port && $_SERVER['SERVER_PORT'] == $port) {
            return true;
        }
        if ($use_https && rcube::get_instance()->config->get('use_https')) {
            return true;
        }

        return false;
    }
public static function https_check ( $ port = null , $ use_https = true ) { if ( ! empty ( $ _SERVER [ 'HTTPS' ] ) && strtolower ( $ _SERVER [ 'HTTPS' ] ) != 'off' ) { return true ; } if ( ! empty ( $ _SERVER [ 'HTTP_X_FORWARDED_PROTO' ] ) && strtolower ( $ _SERVER [ 'HTTP_X_FORWARDED_PROTO' ] ) == 'https' && in_array ( $ _SERVER [ 'REMOTE_ADDR' ] , rcube :: get_instance ( ) -> config -> get ( 'proxy_whitelist' , array ( ) ) ) ) { return true ; } if ( $ port && $ _SERVER [ 'SERVER_PORT' ] == $ port ) { return true ; } if ( $ use_https && rcube :: get_instance ( ) -> config -> get ( 'use_https' ) ) { return true ; } return false ; }
Check if working in SSL mode

@param integer $port      HTTPS port number
@param boolean $use_https Enables 'use_https' option checking

@return boolean
Check if working in SSL mode