public function isSecure()
    {
        if ($this->isUsingTrustedProxy() && $this->server->has(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_PROTO])) {
            $protocolString = $this->server->get(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_PROTO]);
            $protocols = explode(',', $protocolString);

            return count($protocols) > 0 && in_array(strtolower($protocols[0]), ['https', 'ssl', 'on']);
        }

        return $this->server->has('HTTPS') && strtolower($this->server->get('HTTPS')) !== 'off';
    }