public static function isSSLNow()
    {
        $ini = eZINI::instance();
        $sslPort = $ini->variable( 'SiteSettings', 'SSLPort' );
        if ( !$sslPort )
            $sslPort = eZSSLZone::DEFAULT_SSL_PORT;
        // $nowSSl is true if current access mode is HTTPS.
        $nowSSL = ( self::serverPort() == $sslPort );

        if ( !$nowSSL )
        {
            // Check if this request might be driven through a ssl proxy
            if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) )
            {
                $nowSSL = ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' );
            }
            else if ( isset( $_SERVER['HTTP_X_FORWARDED_PORT'] ) )
            {
                $sslPort = $ini->variable( 'SiteSettings', 'SSLPort' );
                $nowSSL = ( $_SERVER['HTTP_X_FORWARDED_PORT'] == $sslPort );
            }
            else if ( isset( $_SERVER['HTTP_X_FORWARDED_SERVER'] ) )
            {
                $sslProxyServerName = $ini->variable( 'SiteSettings', 'SSLProxyServerName' );
                $nowSSL = ( $sslProxyServerName == $_SERVER['HTTP_X_FORWARDED_SERVER'] );
            }
        }
        return $nowSSL;
    }