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);