public static function isSSL()
{
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == "https") {
return true;
}
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != "off") {
return true;
}
return false;
}