Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[Qt] Use system defaults CA
Browse files Browse the repository at this point in the history
The CA certificate we are bundling will expire in Aug/2018.
  • Loading branch information
tmpsantos committed Jan 19, 2017
1 parent dbd7186 commit bf82b07
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 33 deletions.
6 changes: 0 additions & 6 deletions platform/qt/qmapbox.qrc

This file was deleted.

2 changes: 0 additions & 2 deletions platform/qt/qt4.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
find_package(Qt4 REQUIRED)

QT4_ADD_RESOURCES(MBGL_QT_FILES platform/qt/qmapbox.qrc)

set(MBGL_QT_LIBRARIES
PRIVATE Qt4::QtCore
PRIVATE Qt4::QtGui
Expand Down
2 changes: 0 additions & 2 deletions platform/qt/qt5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5Widgets REQUIRED)

QT5_ADD_RESOURCES(MBGL_QT_FILES platform/qt/qmapbox.qrc)

set(MBGL_QT_LIBRARIES
PRIVATE Qt5::Core
PRIVATE Qt5::Gui
Expand Down
1 change: 1 addition & 0 deletions platform/qt/resources/common.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file alias="icon.png">../../../common/icon.png</file>
<file>source1.geojson</file>
<file>source2.geojson</file>
<file>label-arrow.svg</file>
Expand Down
21 changes: 0 additions & 21 deletions platform/qt/src/http_file_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,11 @@
#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
m_ssl.setProtocol(QSsl::SecureProtocols);
#else
// Qt 4 defines SecureProtocols as TLS1 or SSL3, but we don't want SSL3.
m_ssl.setProtocol(QSsl::TlsV1);
#endif

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

void HTTPFileSource::Impl::request(HTTPRequest* req)
Expand All @@ -49,7 +29,6 @@ void HTTPFileSource::Impl::request(HTTPRequest* req)
}

QNetworkRequest networkRequest = req->networkRequest();
networkRequest.setSslConfiguration(m_ssl);

data.first = m_manager->get(networkRequest);
connect(data.first, SIGNAL(finished()), this, SLOT(onReplyFinished()));
Expand Down
2 changes: 0 additions & 2 deletions platform/qt/src/http_file_source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <QObject>
#include <QPair>
#include <QQueue>
#include <QSslConfiguration>
#include <QUrl>
#include <QVector>

Expand All @@ -33,7 +32,6 @@ public slots:
private:
QMap<QUrl, QPair<QNetworkReply *, QVector<HTTPRequest *>>> m_pending;
QNetworkAccessManager *m_manager;
QSslConfiguration m_ssl;
};

} // namespace mbgl

0 comments on commit bf82b07

Please sign in to comment.