1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-06 06:03:23 +01:00

Make Soup check SSL against our shipped root certs.

This commit is contained in:
John Maguire 2014-10-01 15:06:22 +02:00
parent 335f53710d
commit b4784e82fd
3 changed files with 3906 additions and 0 deletions

3894
dist/cacert.pem vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1402,6 +1402,8 @@ if (APPLE)
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources")
install(FILES ../dist/sparkle_pub.pem
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources")
install(FILES ../dist/cacert.pem
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources")
install(DIRECTORY "${QT_QTGUI_LIBRARY_RELEASE}/Versions/Current/Resources/"
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources")

View File

@ -18,6 +18,7 @@
#include <limits>
#include <QCoreApplication>
#include <QDir>
#include <QUuid>
#include "bufferconsumer.h"
@ -27,6 +28,7 @@
#include "gstenginepipeline.h"
#include "core/concurrentrun.h"
#include "core/logging.h"
#include "core/mac_startup.h"
#include "core/signalchecker.h"
#include "core/utilities.h"
#include "internet/internetmodel.h"
@ -857,6 +859,14 @@ void GstEnginePipeline::SourceSetupCallback(GstURIDecodeBin* bin,
QCoreApplication::applicationVersion());
g_object_set(element, "user-agent", user_agent.toUtf8().constData(),
nullptr);
#ifdef Q_OS_DARWIN
// Override the CA cert path for Soup on Mac to our shipped version.
QDir resources_dir(mac::GetResourcesPath());
QString ca_cert_path = resources_dir.filePath("cacert.pem");
g_object_set(element, "ssl-use-system-ca-file", false, nullptr);
g_object_set(element, "ssl-ca-file", ca_cert_path.toUtf8().data(), nullptr);
#endif
}
}