diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-19 10:37:20 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-19 10:37:20 +0200 |
| commit | 6a5198d23412a6d11f78cdef71850e578ca6f8c0 (patch) | |
| tree | 136afe4f0d78018a1ae97a35e770ae792ae66ebc /src/geminiclient.cpp | |
| parent | 9a5c0b8ba8595b9084ad8dc27884b0cbc691459c (diff) | |
| download | kristall-6a5198d23412a6d11f78cdef71850e578ca6f8c0.tar.gz | |
Allows user to skip over invalid TLS connections and fetch the content anyways.
Diffstat (limited to 'src/geminiclient.cpp')
| -rw-r--r-- | src/geminiclient.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/geminiclient.cpp b/src/geminiclient.cpp index a1546d8..8bd8fe0 100644 --- a/src/geminiclient.cpp +++ b/src/geminiclient.cpp @@ -31,7 +31,7 @@ bool GeminiClient::supportsScheme(const QString &scheme) const return (scheme == "gemini"); } -bool GeminiClient::startRequest(const QUrl &url) +bool GeminiClient::startRequest(const QUrl &url, RequestOptions options) { if(url.scheme() != "gemini") return false; @@ -45,6 +45,8 @@ bool GeminiClient::startRequest(const QUrl &url) return false; } + this->options = options; + QSslConfiguration ssl_config = socket.sslConfiguration(); ssl_config.setProtocol(QSsl::TlsV1_2); if(not global_trust.enable_ca) @@ -239,7 +241,7 @@ void GeminiClient::socketReadyRead() { case 1: type = ResourceNotFound; break; case 2: type = ResourceNotFound; break; - case 3: type = BadRequest; break; + case 3: type = ProxyRequest; break; case 9: type = BadRequest; break; } emit networkError(type, meta); @@ -302,6 +304,11 @@ static bool isTrustRelated(QSslError::SslError err) void GeminiClient::sslErrors(QList<QSslError> const & errors) { + if(options & IgnoreTlsErrors) { + socket.ignoreSslErrors(errors); + return; + } + QList<QSslError> remaining_errors = errors; QList<QSslError> ignored_errors; |
