Sets whether this request is sent over a secure connection.

@param bool $isSecure True to mark the request as secure, false to mark it as not secure.

@return static This request.
355837
public function setSecure(bool $isSecure) : Request
    {
        $isStandardPort = ($this->port === ($this->isSecure ? 443 : 80));

        if ($isStandardPort) {
            $this->port = $isSecure ? 443 : 80;
        }

        $this->isSecure = $isSecure;

        return $this;
    }
305720
public static function is_https($trust_proxy_headers = false)
    {
        // Check standard HTTPS header
        if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
           return isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
        }

        // Check proxy headers if allowed
        return $trust_proxy_headers && isset($_SERVER['X-FORWARDED-PROTO']) && $_SERVER['X-FORWARDED-PROTO'] == 'https';

        // Default to not SSL
        return false;
    }
1178272
public function isSsl()
    {
        if ($this->server('HTTPS') && ('1' == $this->server('HTTPS') || 'on' == strtolower($this->server('HTTPS')))) {
            return true;
        } elseif ($this->server('SERVER_PORT') && ('443' == $this->server('SERVER_PORT'))) {
            return true;
        }
        return false;
    }
688390
private function setSecureConnection(array $params)
    {
        if (! isset($params['ssl_key']) &&
            ! isset($params['ssl_cert']) &&
            ! isset($params['ssl_ca']) &&
            ! isset($params['ssl_capath']) &&
            ! isset($params['ssl_cipher'])
        ) {
            return;
        }

        $this->conn->ssl_set(
            $params['ssl_key']    ?? null,
            $params['ssl_cert']   ?? null,
            $params['ssl_ca']     ?? null,
            $params['ssl_capath'] ?? null,
            $params['ssl_cipher'] ?? null
        );
    }
75936
public function secure($secure = null)
    {
        if (func_num_args() === 0) {
            return $this->_data['secure'];
        }
        return $this->_data['secure'] = (boolean) $secure;
    }
1110403
public function setRequestIsSSL($isSSL = FALSE)
    {
        $this->isSSL = $isSSL;
        $this->debug->info(__FUNCTION__, 'setRequestIsSSL: ', $this->isSSL);

        return $this;
    }
336382
public function connect($host, $port = 80, $secure = false)
    {
        $this->log("Connecting to: ${host}:${port}");
        return parent::connect($host, $port, $secure);
    }
961261
public function setTLS($isEnabled)
    {
        if (!is_bool($isEnabled)) {
            throw new InvalidArgumentException(
                sprintf('%s only accepts a boolean', __FUNCTION__)
            );
        }

        $this->tls = (bool)$isEnabled;

        return $this;
    }
335346
public function setCost($cost)
    {
        if ($cost < 4 || $cost > 31) {
            throw new \InvalidArgumentException(sprintf("Invalid bcrypt cost parameter specified: %s", $cost));
        }
        $this->cost = $cost;
        return $this;
    }
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;
    }
132985
public function secure($secure = null)
    {
        if ($secure !== null) {
            $this->secure = (bool) $secure;
        }

        return (bool) $this->secure;
    }
1258725
public function withMock(bool $ssl): self
    {
        $settings = ['websocket_mask' => true];
        if ($ssl) {
            $settings['ssl_host_name'] = $this->uri->getHost();
        }
        $this->client->set($settings);

        return $this;
    }
1074955
public static function secure( $uri = '', $params = array(), $retain = false ) 
	{
		return 'https://'.CCIn::host().static::to( $uri, $params, $retain );
	}
969673
public function setHttpStatusCode(int $httpStatusCode): self
    {
        if (!array_key_exists($httpStatusCode, Response::$statusTexts)) {
            $this->internalServerError('Invalid status code in ' . __METHOD__, Response::$statusTexts);
        }
        $this->httpStatusCode = $httpStatusCode;
        return $this;
    }
67696
public function verifyHost($on = true)
    {
        Argument::i()->test(1, 'bool'); //argument 1 must be a boolean

        $this->options[CURLOPT_SSL_VERIFYHOST] = $on ? 1 : 2;
        return $this;
    }
1324726
public function setSecurityStatus($securityStatus)
    {

        if (!is_null($securityStatus) && ($securityStatus > 10)) {
            throw new \InvalidArgumentException('invalid value for $securityStatus when calling GetCharactersCharacterIdOk., must be smaller than or equal to 10.');
        }
        if (!is_null($securityStatus) && ($securityStatus < -10)) {
            throw new \InvalidArgumentException('invalid value for $securityStatus when calling GetCharactersCharacterIdOk., must be bigger than or equal to -10.');
        }

        $this->container['securityStatus'] = $securityStatus;

        return $this;
    }
992872
public function applySecurityRules(bool $secure = false, bool $httponly = false)
    {
        $nb_engine = CNabuEngine::getEngine();

        $attrs = session_get_cookie_params();
        session_set_cookie_params(
            $attrs['lifetime'],
            $attrs['path'],
            $attrs['domain'],
            $secure || $attrs['secure'],
            $httponly || (array_key_exists('httponly', $attrs) && $attrs['httponly'])
        );

        session_start();
        $nb_engine->traceLog("Session ID", session_id());

        $this->purgeNonce();

        if (isset($_SESSION) && count($_SESSION) > 0) {
            foreach ($_SESSION as $value) {
                if ($value instanceof INabuDBObject && !$value->isBuiltIn()) {
                    $value->relinkDB();
                }
            }
        }
    }