public function isSecure() : bool
    {
        if ($this->isUsingTrustedProxy() && $this->server->has(self::$trustedHeaderNames[RequestHeaders::CLIENT_PROTO])) {
            $protoString = $this->server->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_PROTO]);
            $protoArray = explode(',', $protoString);

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

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