From 9c2befc386effdf1e28acc9ff5231c200b89bd7d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 19 Jul 2018 23:19:00 -0700 Subject: [PATCH] Only require OpenSSL 1.1 on Apple platforms where SecureTransport requires keys from PEM_write_bio_PrivateKey_traditional() --- app/backend/identitymanager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/backend/identitymanager.cpp b/app/backend/identitymanager.cpp index 91893d88..64849d6a 100644 --- a/app/backend/identitymanager.cpp +++ b/app/backend/identitymanager.cpp @@ -157,10 +157,14 @@ IdentityManager::getSslKey() // We must write out our PEM in the old PKCS1 format for SecureTransport // on macOS/iOS to be able to read it. +#ifdef Q_OS_DARWIN + PEM_write_bio_PrivateKey_traditional(bio, pk, nullptr, nullptr, 0, nullptr, 0); +#else + PEM_write_bio_PrivateKey(bio, pk, nullptr, nullptr, 0, nullptr, 0); +#endif + BUF_MEM* mem; BIO_get_mem_ptr(bio, &mem); - PEM_write_bio_PrivateKey_traditional(bio, pk, nullptr, nullptr, 0, nullptr, 0); - m_CachedSslKey = QSslKey(QByteArray::fromRawData(mem->data, (int)mem->length), QSsl::Rsa); BIO_free(bio);