ubuntu zeal ssl报错解决记录

zeal SSL handshake failed

解决方法记录: https://github.com/zealdocs/zeal/issues/1307

In my case, I was also unable to download any of the available docsets with Zeal v0.6.1 installed from the official repositories of Ubuntu 22.04 via sudo apt-get install zeal. In try to resolve this issue, I installed additional dependencies:

sudo apt-get install extra-cmake-modules libqt5x11extras5-dev libxcb-keysyms1-dev libsqlite3-dev
and built Zeal from this repository using the following:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -- -j$(nproc)

However, the issue persisted. Upon further investigation, I discovered that the SSL certificate on https://go.zealdocs.org (RedirectServerUrl) had expired on Thursday, July 27, 2023 at 1:00:09 AM
. Despite this, the required content was still accessible. To bypass the SSL errors, I wrote the following patch:

diff --git a/src/libs/ui/docsetsdialog.cpp b/src/libs/ui/docsetsdialog.cpp
index 5195454..bfab2da 100644
--- a/src/libs/ui/docsetsdialog.cpp
+++ b/src/libs/ui/docsetsdialog.cpp
@@ -675,6 +675,13 @@ bool DocsetsDialog::updatesAvailable() const
 QNetworkReply *DocsetsDialog::download(const QUrl &url)
 {
     QNetworkReply *reply = m_application->download(url);
+
+    // Connect to the reply's sslErrors signal to handle SSL errors
+    connect(reply, &QNetworkReply::sslErrors, [=](const QList<QSslError>& errors){
+        // Ignore all SSL errors
+        reply->ignoreSslErrors();
+    });
+
     connect(reply, &QNetworkReply::downloadProgress, this, &DocsetsDialog::downloadProgress);
     connect(reply, &QNetworkReply::finished, this, &DocsetsDialog::downloadCompleted);
     m_replies.append(reply);
  • 10
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值