From 243268b59a92a610b7820b7c3fe5167d094d58d3 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 24 Apr 2023 00:05:06 -0400 Subject: [PATCH] Disable ssl handshake for now. --- download.cpp | 3 +++ network.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/download.cpp b/download.cpp index afe141ac..2a9742d8 100644 --- a/download.cpp +++ b/download.cpp @@ -87,6 +87,9 @@ void Download::downloadModel(const QString &modelFile) } QNetworkRequest request("http://gpt4all.io/models/" + modelFile); + QSslConfiguration conf = request.sslConfiguration(); + conf.setPeerVerifyMode(QSslSocket::VerifyNone); + request.setSslConfiguration(conf); QNetworkReply *modelReply = m_networkManager.get(request); connect(modelReply, &QNetworkReply::downloadProgress, this, &Download::handleDownloadProgress); connect(modelReply, &QNetworkReply::finished, this, &Download::handleModelDownloadFinished); diff --git a/network.cpp b/network.cpp index ab2d54fc..2026622e 100644 --- a/network.cpp +++ b/network.cpp @@ -80,6 +80,9 @@ bool Network::packageAndSendJson(const QString &ingestId, const QString &json) #endif QUrl jsonUrl("https://api.gpt4all.io/v1/ingest/chat"); QNetworkRequest request(jsonUrl); + QSslConfiguration conf = request.sslConfiguration(); + conf.setPeerVerifyMode(QSslSocket::VerifyNone); + request.setSslConfiguration(conf); QByteArray body(newDoc.toJson()); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); QNetworkReply *jsonReply = m_networkManager.post(request, body); @@ -132,6 +135,9 @@ void Network::sendHealth() { QUrl healthUrl("https://api.gpt4all.io/v1/health"); QNetworkRequest request(healthUrl); + QSslConfiguration conf = request.sslConfiguration(); + conf.setPeerVerifyMode(QSslSocket::VerifyNone); + request.setSslConfiguration(conf); QNetworkReply *healthReply = m_networkManager.get(request); connect(healthReply, &QNetworkReply::finished, this, &Network::handleHealthFinished); }