Return if the request is sent via secure channel (https).
@return bool if the request is sent via secure channel (https)
327842
public function getIsSecureConnection()
    {
        $https = $this->getServerParam('HTTPS');
        if ($https !== null && (strcasecmp($https, 'on') === 0 || $https == 1)) {
            return true;
        }
        foreach ($this->secureProtocolHeaders as $header => $values) {
            if ($this->hasHeader($header)) {
                foreach ($values as $value) {
                    if (strcasecmp($this->getHeaderLine($header), $value) === 0) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
673310
public function isRequestSecured()
    {
        $remoteAddress = $this->server()->remoteAddress();

        $protocol = $this->server()->serverProtocol();
        $fwdProto = $this->server()->get($this->getTrustedHeaders()['client_proto']);
        if ($fwdProto && $fwdProto != '' && in_array($remoteAddress, $this->getTrustedProxies())) {
            $protocol = $fwdProto;
        }
        $protocol = strtolower($protocol);

        $isSecured = in_array($protocol, [
                'https',
                'on',
                '1'
            ]);

        if (!$isSecured) {
            if (in_array(strtolower($this->server()->https()), [
                    'https',
                    'on',
                    '1'
                ])) {
                $isSecured = true;
            }
        }

        return $isSecured;
    }
611436
public function requestValid()
    {
        $requestValid = true;

        $request = $this->getRequest();

        $ipnRequestVerifier = $this->getIPNRequestVerifier();
        $ipnRequestVerifier->setRequest($request);
        $ipnRequestVerifier->setShopOwner($this->getPayPalConfig()->getUserEmail());
        $requestCorrect = $ipnRequestVerifier->requestCorrect();

        if (!$requestCorrect) {
            $requestValid = false;

            $logger = $this->getLogger();
            $logger->setTitle("IPN VERIFICATION FAILURE BY PAYPAL");
            $logger->log($ipnRequestVerifier->getFailureMessage());
        }

        return $requestValid;
    }
1138111
protected function isAllowed()
    {
        if ($this->verifyCookie() || $this->allowAdmins() || $this->allowUsers() || $this->allowedIpAddress()) {
            return true;
        }

        return false;
    }
1099393
public static function isThickBox()
    {
        $referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : null;

        if ((isset($_GET['is_thickbox']) && $_GET['is_thickbox'] == 'true')
            || strpos($referer, 'is_thickbox=true') > -1) {
            return true;
        } else {
            return false;
        }
    }
1259046
public function getSecurePort()
    {
        if ($this->_securePort === null) {
            $this->_securePort = $this->isSecureConnection() && isset($_SERVER['SERVER_PORT']) ? (int)$_SERVER['SERVER_PORT'] : 443;
        }
        return $this->_securePort;
    }
854980
public function hasDefaultPort(): bool
    {
        if (!$this->parsedUri->hasPort()) {
            return true;
        }

        if ($this->isHttp() && $this->parsedUri->portEquals(Http::PORT)) {
            return true;
        }

        if ($this->isHttps() && $this->parsedUri->portEquals(Http::PORT_SSL)) {
            return true;
        }

        return false;
    }
1215832
protected function isSSLRequest()
    {
        if (isset($_SERVER['HTTPS'])) {
            if ('on' == strtolower($_SERVER['HTTPS'])) {
                return true;
            }

            if ('1' == $_SERVER['HTTPS']) {
                return true;
            }
        } elseif (isset($_SERVER['SERVER_PORT']) && ('443' == $_SERVER['SERVER_PORT'])) {
            return true;
        }

        return false;
    }
51918
public function isAuthenticated()
    {
        $client = parent::getHttpClient();
        if ($client->getClientLoginToken() ||
            $client->getAuthSubToken()
        ) {
            return true;
        }

        return false;
    }
1145778
@Override
    public boolean isSecure() {
        boolean secure = (null != this.connection.getSSLContext());
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "isSecure: " + secure);
        }
        return secure;
    }
592279
protected static function checkHttpXForwardedProto(Request $request): bool
    {
        return $request->server->has('HTTP_X_FORWARDED_PROTO') && 'https' === $request->server->get('HTTP_X_FORWARDED_PROTO');
    }
980887
public function _isSsl() {
        $server = $_SERVER;
        if (isset($server['HTTPS']) && ('1' == $server['HTTPS'] || 'on' == strtolower($server['HTTPS']))) {
            return true;
        }
        elseif (isset($server['REQUEST_SCHEME']) && 'https' == $server['REQUEST_SCHEME']) {
            return true;
        }
        elseif (isset($server['SERVER_PORT']) && ('443' == $server['SERVER_PORT'])) {
            return true;
        }
        elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && 'https' == $server['HTTP_X_FORWARDED_PROTO']) {
            return true;
        }
        return false;
    }
860750
private function checkHttpStatusCodeRule()
    {
        if (isset($this->httpStatusCode)
            && $this->httpStatusCode >= 500
            && $this->httpStatusCode <= 599
        ) {
            $this->log[] = 'Disallowed by HTTP status code 5xx';
            return true;
        }
        return false;
    }
595055
public function isValid()
	{
		if ($this->isEmpty()) {
			return false;
		}
		$requiresHost = ! $this->port->isEmpty() || ! $this->credentials->isEmpty() || $this->scheme->equals('http') || $this->scheme->equals('https');
		if ($requiresHost && $this->host->isEmpty()) {
			return false;
		}
		$requiresPath = (! $this->query->isEmpty() || ! $this->fragment->isEmpty()) && (! $this->scheme->isEmpty() || ! $this->host->isEmpty() || ! $this->port->isEmpty() || ! $this->credentials->isEmpty());
		if ($requiresPath && $this->path->isEmpty()) {
			return false;
		}
		return true;
	}
303748
protected static function checkHttps(Request $request): bool
    {
        return $request->server->has('HTTPS') && 'on' === $request->server->get('HTTPS');
    }
106877
public static function is_https(HTTPRequest $request = null)
    {
        // Check override from alternate_base_url
        if ($baseURL = self::config()->uninherited('alternate_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        // Check the current request
        $request = static::currentRequest($request);
        if ($request && ($scheme = $request->getScheme())) {
            return $scheme === 'https';
        }

        // Check default_base_url
        if ($baseURL = self::config()->uninherited('default_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        return false;
    }
1073266
public function isStarved()
    {
        foreach ($this->getNsqdConns() as $conn) {
            $threshold = intval($conn->lastRDY() * 0.85);
            $inFlight = $conn->getMsgInFlight();

            if ($inFlight >= $threshold && $inFlight > 0 && !$conn->isClosing()) {
                return true;
            }
        }
        return false;
    }