From d0b31da4b53e6aa4630dec9eef9435246889d6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 19 May 2015 22:28:51 +0200 Subject: [PATCH] GH-960 possible fix for missing OSX ca certs --- .gitattributes | 1 + application/CMakeLists.txt | 1 + application/MultiMC.cpp | 13 +++++++++++++ application/MultiMC.h | 1 + .../Equifax_Secure_Certificate_Authority.pem | 19 +++++++++++++++++++ application/resources/certs/certs.qrc | 7 +++++++ 6 files changed, 42 insertions(+) create mode 100644 .gitattributes create mode 100644 application/resources/certs/Equifax_Secure_Certificate_Authority.pem create mode 100644 application/resources/certs/certs.qrc diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..2a31189dc --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pem -crlf diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index b179927fe..b35eabea5 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -313,6 +313,7 @@ set(MULTIMC_QRCS resources/iOS/iOS.qrc resources/instances/instances.qrc resources/versions/versions.qrc + resources/certs/certs.qrc ) ######## Windows resource files ######## diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index aae8d1545..122890d13 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -236,6 +236,8 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar ENV.updateProxySettings(proxyTypeStr, addr, port, user, pass); } + initSSL(); + m_translationChecker->downloadTranslations(); //FIXME: what to do with these? @@ -271,6 +273,17 @@ MultiMC::~MultiMC() } } +void MultiMC::initSSL() +{ +#ifdef Q_OS_MAC + Q_INIT_RESOURCE(certs); + QFile equifaxFile(":/certs/Equifax_Secure_Certificate_Authority.pem"); + equifaxFile.open(QIODevice::ReadOnly); + QSslCertificate equifaxCert(equifaxFile.readAll(), QSsl::Pem); + QSslSocket::addDefaultCaCertificate(equifaxCert); +#endif +} + void MultiMC::initTranslations() { QLocale locale(m_settings->get("Language").toString()); diff --git a/application/MultiMC.h b/application/MultiMC.h index b78bbbd27..8215e4adf 100644 --- a/application/MultiMC.h +++ b/application/MultiMC.h @@ -152,6 +152,7 @@ private: void initGlobalSettings(bool test_mode); void initTranslations(); + void initSSL(); private: friend class UpdateCheckerTest; diff --git a/application/resources/certs/Equifax_Secure_Certificate_Authority.pem b/application/resources/certs/Equifax_Secure_Certificate_Authority.pem new file mode 100644 index 000000000..b5dd02fc7 --- /dev/null +++ b/application/resources/certs/Equifax_Secure_Certificate_Authority.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- \ No newline at end of file diff --git a/application/resources/certs/certs.qrc b/application/resources/certs/certs.qrc new file mode 100644 index 000000000..32739c33d --- /dev/null +++ b/application/resources/certs/certs.qrc @@ -0,0 +1,7 @@ + + + + Equifax_Secure_Certificate_Authority.pem + + +