summaryrefslogtreecommitdiffstats
path: root/application/CertWorkaround.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-29 01:06:26 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-29 01:06:26 +0200
commitb7ff8a4c1c8ae8381d018705ccf384fb8cc9d619 (patch)
tree004f517204a7c167fcb96d3f46c41578e4d86537 /application/CertWorkaround.cpp
parent22c0d5cf46643d509f8c3ee2b17c54774b8099a6 (diff)
downloadMultiMC-b7ff8a4c1c8ae8381d018705ccf384fb8cc9d619.tar
MultiMC-b7ff8a4c1c8ae8381d018705ccf384fb8cc9d619.tar.gz
MultiMC-b7ff8a4c1c8ae8381d018705ccf384fb8cc9d619.tar.lz
MultiMC-b7ff8a4c1c8ae8381d018705ccf384fb8cc9d619.tar.xz
MultiMC-b7ff8a4c1c8ae8381d018705ccf384fb8cc9d619.zip
GH-1202 rebuild SSL certs on start on OSX - part 2
Diffstat (limited to 'application/CertWorkaround.cpp')
-rw-r--r--application/CertWorkaround.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/application/CertWorkaround.cpp b/application/CertWorkaround.cpp
index 900343de..fcfa34ea 100644
--- a/application/CertWorkaround.cpp
+++ b/application/CertWorkaround.cpp
@@ -20,7 +20,8 @@
* \return A list of new QSslCertificates generated from the
* KeyChain DER data.
*/
-static QList<QSslCertificate> LoadCertificatesFromKeyChain(const std::string &keyChainPath = std::string())
+static QList<QSslCertificate>
+LoadCertificatesFromKeyChain(const std::string &keyChainPath = std::string())
{
QList<QSslCertificate> qtCerts;
@@ -71,11 +72,11 @@ static QList<QSslCertificate> LoadCertificatesFromKeyChain(const std::string &ke
// create a Qt certificate from the data and add it to the list
QSslCertificate qtCert(byteArray, QSsl::Der);
- std::cout << "COMMON NAME: "
- << qtCert.issuerInfo(QSslCertificate::CommonName).toStdString().c_str()
- << " ORG NAME: "
- << qtCert.issuerInfo(QSslCertificate::Organization).toStdString().c_str()
- << std::endl;
+ qDebug() << "COMMON NAME: "
+ << qtCert.issuerInfo(QSslCertificate::CommonName).join('\n')
+ << " ORG NAME: "
+ << qtCert.issuerInfo(QSslCertificate::Organization).join('\n')
+ << std::endl;
qtCerts << qtCert;
}
@@ -107,12 +108,12 @@ void RebuildQtCertificates()
{
if (!existingCerts.contains(qtCert))
{
- std::cout << "cert not known to Qt - adding" << std::endl;
- std::cout << "COMMON NAME: "
- << qtCert.issuerInfo(QSslCertificate::CommonName).toStdString().c_str()
- << " ORG NAME: "
- << qtCert.issuerInfo(QSslCertificate::Organization).toStdString().c_str()
- << std::endl;
+ qDebug() << "cert not known to Qt - adding";
+ qDebug() << "COMMON NAME: "
+ << qtCert.issuerInfo(QSslCertificate::CommonName).join('\n')
+ << " ORG NAME: "
+ << qtCert.issuerInfo(QSslCertificate::Organization).join('\n')
+ << std::endl;
QSslSocket::addDefaultCaCertificate(qtCert);
}