From 108935ee4aa3171984c126de89978bcea1a01390 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 25 Aug 2026 09:18:43 +0300 Subject: [PATCH] Show SSL warning when Qt does not have working TLS plugin IB-9085, #1442 Signed-off-by: Raul Metsma --- client/Application.cpp | 56 +++++++++++++++++++++++++++------------ client/Diagnostics.cpp | 10 +++++++ client/translations/en.ts | 8 ++++++ client/translations/et.ts | 8 ++++++ 4 files changed, 65 insertions(+), 17 deletions(-) diff --git a/client/Application.cpp b/client/Application.cpp index 66b4107d5..db1ac0a34 100644 --- a/client/Application.cpp +++ b/client/Application.cpp @@ -70,6 +70,7 @@ class MacMenuBar {}; #include #include #include +#include #include #include #include @@ -484,32 +485,53 @@ Application::Application( int &argc, char **argv ) } QMetaObject::invokeMethod(this, [this] { + auto showSslWarning = [this] { + if(QSslSocket::supportsSsl()) + return; + WarningDialog::create() + ->withTitle(tr("Secure network support is unavailable")) + ->withText(tr("DigiDoc4 Client could not load a compatible TLS library. " + "Mobile-ID, Smart-ID, configuration updates, and other online services may not work. " + "Check for conflicting OpenSSL installations or reinstall ID-software.")) + ->withDetails(QStringLiteral("Qt (%1)\nOpenSSL build (%2)\nOpenSSL current (%3)") + .arg(QString::fromLatin1(qVersion()), QSslSocket::sslLibraryBuildVersionString(), + QSslSocket::sslLibraryVersionString())) + ->open(); + }; + auto showPluginWarning = [this, showSslWarning] { #ifdef Q_OS_MAC - if(!Settings::PLUGINS.isSet()) - { - auto *dlg = WarningDialog::create() - ->withText(tr("In order to authenticate and sign in e-services with an ID-card you need to install the web browser components.")) - ->setCancelText(tr("Ignore forever")) - ->addButton(tr("Remind later"), QMessageBox::Ignore) - ->addButton(tr("Install"), QMessageBox::Open); - connect(dlg, &WarningDialog::finished, this, [](int result) { - switch(result) - { - case QMessageBox::Open: QDesktopServices::openUrl(tr("https://www.id.ee/en/article/install-id-software/")); break; - case QMessageBox::Ignore: break; - default: Settings::PLUGINS = QStringLiteral("ignore"); - } - }); - dlg->open(); - } + if(!Settings::PLUGINS.isSet()) + { + auto *dlg = WarningDialog::create() + ->withText(tr("In order to authenticate and sign in e-services with an ID-card you need to install the web browser components.")) + ->setCancelText(tr("Ignore forever")) + ->addButton(tr("Remind later"), QMessageBox::Ignore) + ->addButton(tr("Install"), QMessageBox::Open); + connect(dlg, &WarningDialog::finished, this, [showSslWarning](int result) { + switch(result) + { + case QMessageBox::Open: QDesktopServices::openUrl(tr("https://www.id.ee/en/article/install-id-software/")); break; + case QMessageBox::Ignore: break; + default: Settings::PLUGINS = QStringLiteral("ignore"); + } + showSslWarning(); + }); + dlg->open(); + return; + } #endif + showSslWarning(); + }; if(Settings::SHOW_INTRO) { Settings::SHOW_INTRO = false; auto *dlg = new FirstRun(mainWindow()); connect(dlg, &FirstRun::langChanged, this, &Application::loadTranslation); + connect(dlg, &FirstRun::finished, this, showPluginWarning); dlg->open(); } + else + showPluginWarning(); }, Qt::QueuedConnection); if( !args.isEmpty() || topLevelWindows().isEmpty() ) diff --git a/client/Diagnostics.cpp b/client/Diagnostics.cpp index c2c8b9aac..7ea255be1 100644 --- a/client/Diagnostics.cpp +++ b/client/Diagnostics.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -39,6 +40,15 @@ static QTextStream &operator<<(QTextStream &s, bool result) void Diagnostics::generalInfo(QTextStream &s) { + if(!QSslSocket::supportsSsl()) + { + s << "" << Application::tr("Secure network support is unavailable") + << "
" << Application::tr( + "DigiDoc4 Client could not load a compatible TLS library. " + "Mobile-ID, Smart-ID, configuration updates, and other online services may not work. " + "Check for conflicting OpenSSL installations or reinstall ID-software.") + << "

"; + } s << "" << tr("Arguments:") << " " << Application::arguments().join(' ') << "
" << "" << tr("Library paths:") << " " << QCoreApplication::libraryPaths().join(';') << "
" << "" << "URLs:" << "" diff --git a/client/translations/en.ts b/client/translations/en.ts index e0ee8edf5..64b6fde02 100644 --- a/client/translations/en.ts +++ b/client/translations/en.ts @@ -220,6 +220,14 @@ New Window New Window + + Secure network support is unavailable + Secure network support is unavailable + + + DigiDoc4 Client could not load a compatible TLS library. Mobile-ID, Smart-ID, configuration updates, and other online services may not work. Check for conflicting OpenSSL installations or reinstall ID-software. + DigiDoc4 Client could not load a compatible TLS library. Mobile-ID, Smart-ID, configuration updates, and other online services may not work. Check for conflicting OpenSSL installations or reinstall ID-software. + In order to authenticate and sign in e-services with an ID-card you need to install the web browser components. In order to authenticate and sign in e-services with an ID-card you need to install the web browser components. diff --git a/client/translations/et.ts b/client/translations/et.ts index b8052a14a..335d8a2f5 100644 --- a/client/translations/et.ts +++ b/client/translations/et.ts @@ -220,6 +220,14 @@ New Window Ava uus aken + + Secure network support is unavailable + Turvaline võrguühendus pole saadaval + + + DigiDoc4 Client could not load a compatible TLS library. Mobile-ID, Smart-ID, configuration updates, and other online services may not work. Check for conflicting OpenSSL installations or reinstall ID-software. + DigiDoc4 Client ei saanud ühilduvat TLS-teeki laadida. Mobiil-ID, Smart-ID, konfiguratsiooni uuendamine ja muud võrguteenused ei pruugi töötada. Kontrolli vastuolulisi OpenSSL-i paigaldusi või paigalda ID-tarkvara uuesti. + In order to authenticate and sign in e-services with an ID-card you need to install the web browser components. ID-kaardiga e-teenustes autentimiseks ja allkirjastamiseks on vajalik paigaldada ka veebilehitseja komponendid.