From 59f17ab8f3a62fb9f214a88967f62f4ea924f2b4 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 27 Feb 2018 14:00:52 +0100 Subject: [PATCH] Fix missing Qt platform styles and CA bundles in Windows release deployment --- src/CMakeLists.txt | 9 ++++++++- src/gui/EditWidgetIcons.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd7527e03..8c3245a28 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -384,7 +384,11 @@ if(MINGW) # install Qt5 plugins set(PLUGINS_DIR ${Qt5_PREFIX}/share/qt5/plugins) - install(FILES ${PLUGINS_DIR}/platforms/qwindows$<$:d>.dll DESTINATION "platforms") + install(FILES + ${PLUGINS_DIR}/platforms/qwindows$<$:d>.dll + ${PLUGINS_DIR}/platforms/qdirect2d$<$:d>.dll + DESTINATION "platforms") + install(FILES ${PLUGINS_DIR}/styles/qwindowsvistastyle$<$:d>.dll DESTINATION "styles") install(FILES ${PLUGINS_DIR}/platforminputcontexts/qtvirtualkeyboardplugin$<$:d>.dll DESTINATION "platforminputcontexts") install(FILES ${PLUGINS_DIR}/iconengines/qsvgicon$<$:d>.dll DESTINATION "iconengines") install(FILES @@ -395,4 +399,7 @@ if(MINGW) ${PLUGINS_DIR}/imageformats/qsvg$<$:d>.dll ${PLUGINS_DIR}/imageformats/qwebp$<$:d>.dll DESTINATION "imageformats") + + # install CA cert chains + install(FILES ${Qt5_PREFIX}/ssl/certs/ca-bundle.crt DESTINATION "ssl/certs") endif() diff --git a/src/gui/EditWidgetIcons.cpp b/src/gui/EditWidgetIcons.cpp index 9a73c293c..1c33150b5 100644 --- a/src/gui/EditWidgetIcons.cpp +++ b/src/gui/EditWidgetIcons.cpp @@ -202,6 +202,13 @@ QImage EditWidgetIcons::fetchFavicon(const QUrl& url) curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &imagedata); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writeCurlResponse); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); +#ifdef Q_OS_WIN + const QDir appDir = QFileInfo(QCoreApplication::applicationFilePath()).absoluteDir(); + if (appDir.exists("ssl\\certs")) { + curl_easy_setopt(curl, CURLOPT_CAINFO, (appDir.absolutePath() + "\\ssl\\certs\\ca-bundle.crt").toLatin1().data()); + } +#endif // Perform the request in another thread CURLcode result = AsyncTask::runAndWaitForFuture([curl]() {