aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gitlab/queryrunner.cpp
diff options
context:
space:
mode:
authorChristian Stenger <[email protected]>2022-06-08 09:00:23 +0200
committerChristian Stenger <[email protected]>2022-06-10 12:27:45 +0000
commit0cfd264279df9815b281aaac8e28717e9d79a9e7 (patch)
tree8a1b8b143fe000f7cd94b0c8d410300b6699c54c /src/plugins/gitlab/queryrunner.cpp
parentfdb413c9a7654f652e8770fde7ae8a574219f333 (diff)
GitLab: Handle certificate issues
Allow to bypass certificate verifications. Currently the bypassing is not stored into the settings, so this is not permanent. Change-Id: Ieb564464a28cf2d4973c6b1baa696d6c22b07177 Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/gitlab/queryrunner.cpp')
-rw-r--r--src/plugins/gitlab/queryrunner.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/gitlab/queryrunner.cpp b/src/plugins/gitlab/queryrunner.cpp
index ad15e748c7b..0e54a99a092 100644
--- a/src/plugins/gitlab/queryrunner.cpp
+++ b/src/plugins/gitlab/queryrunner.cpp
@@ -102,9 +102,10 @@ QString Query::toString() const
QueryRunner::QueryRunner(const Query &query, const Utils::Id &id, QObject *parent)
: QObject(parent)
+ , m_serverId(id)
{
const GitLabParameters *p = GitLabPlugin::globalParameters();
- const auto server = p->serverForId(id);
+ const auto server = p->serverForId(m_serverId);
QStringList args = server.curlArguments();
m_paginated = query.hasPaginatedResults();
if (m_paginated)
@@ -161,7 +162,18 @@ void QueryRunner::processFinished()
if (m_process.exitStatus() != QProcess::NormalExit) {
errorTermination(tr("%1 crashed.").arg(executable));
return;
- } else if (m_process.exitCode()) {
+ } else if (int exitCode = m_process.exitCode()) {
+ if (exitCode == 35 || exitCode == 60) { // common ssl certificate issues
+ if (GitLabPlugin::handleCertificateIssue(m_serverId)) {
+ m_running = false;
+ // prepend -k for re-requesting the same query
+ Utils::CommandLine cmdline = m_process.commandLine();
+ cmdline.prependArgs({"-k"});
+ m_process.setCommand(cmdline);
+ start();
+ return;
+ }
+ }
errorTermination(tr("%1 returned %2.").arg(executable).arg(m_process.exitCode()));
return;
}