Disable ssl handshake for now.

This commit is contained in:
Adam Treat 2023-04-24 00:05:06 -04:00
parent 9dbeffc888
commit fa9f4cca62
2 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,9 @@ void Download::downloadModel(const QString &modelFile)
} }
QNetworkRequest request("http://gpt4all.io/models/" + 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); QNetworkReply *modelReply = m_networkManager.get(request);
connect(modelReply, &QNetworkReply::downloadProgress, this, &Download::handleDownloadProgress); connect(modelReply, &QNetworkReply::downloadProgress, this, &Download::handleDownloadProgress);
connect(modelReply, &QNetworkReply::finished, this, &Download::handleModelDownloadFinished); connect(modelReply, &QNetworkReply::finished, this, &Download::handleModelDownloadFinished);

View File

@ -80,6 +80,9 @@ bool Network::packageAndSendJson(const QString &ingestId, const QString &json)
#endif #endif
QUrl jsonUrl("https://api.gpt4all.io/v1/ingest/chat"); QUrl jsonUrl("https://api.gpt4all.io/v1/ingest/chat");
QNetworkRequest request(jsonUrl); QNetworkRequest request(jsonUrl);
QSslConfiguration conf = request.sslConfiguration();
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
request.setSslConfiguration(conf);
QByteArray body(newDoc.toJson()); QByteArray body(newDoc.toJson());
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QNetworkReply *jsonReply = m_networkManager.post(request, body); QNetworkReply *jsonReply = m_networkManager.post(request, body);
@ -132,6 +135,9 @@ void Network::sendHealth()
{ {
QUrl healthUrl("https://api.gpt4all.io/v1/health"); QUrl healthUrl("https://api.gpt4all.io/v1/health");
QNetworkRequest request(healthUrl); QNetworkRequest request(healthUrl);
QSslConfiguration conf = request.sslConfiguration();
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
request.setSslConfiguration(conf);
QNetworkReply *healthReply = m_networkManager.get(request); QNetworkReply *healthReply = m_networkManager.get(request);
connect(healthReply, &QNetworkReply::finished, this, &Network::handleHealthFinished); connect(healthReply, &QNetworkReply::finished, this, &Network::handleHealthFinished);
} }