[Qt] Use Qt resources for bundling the certificates

This commit is contained in:
Thiago Marcos P. Santos
2015-12-10 16:33:09 -08:00
parent b9bbe68fe0
commit efb96e80ec
6 changed files with 26 additions and 1 deletions

View File

@@ -9,10 +9,18 @@
#include <QNetworkReply>
#include <QSslConfiguration>
// Needs to be on the global namespace
// for linking purposes.
void initResources() {
Q_INIT_RESOURCE(qmapbox);
}
namespace mbgl {
HTTPFileSource::Impl::Impl() : m_manager(new QNetworkAccessManager(this))
{
initResources();
QNetworkProxyFactory::setUseSystemConfiguration(true);
#if QT_VERSION >= 0x050000
@@ -22,7 +30,7 @@ HTTPFileSource::Impl::Impl() : m_manager(new QNetworkAccessManager(this))
m_ssl.setProtocol(QSsl::TlsV1);
#endif
m_ssl.setCaCertificates(QSslCertificate::fromPath("ca-bundle.crt"));
m_ssl.setCaCertificates(QSslCertificate::fromPath(":ca-bundle.crt"));
if (m_ssl.caCertificates().isEmpty()) {
mbgl::Log::Warning(mbgl::Event::HttpRequest, "Could not load list of certificate authorities");
}