Fix loading of OpenSSL on macOS versions that ship its own OpenSSL
The unversioned libcrypto.dylib that's shipped with macOS 10.15 will result in a crash if loaded, with a message saying that the unversioned library should not be loaded, as it doesn't provide a stable ABI. Task-number: QTBUG-95249 Pick-to: 6.2 5.15 Change-Id: I49325e5d675155e90840cc93623549f725bc77b4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
7d475a8656
commit
c70bb357cc
@ -819,6 +819,11 @@ static LoadedOpenSsl loadOpenSsl()
|
|||||||
const QStringList cryptoList = findAllLibCrypto();
|
const QStringList cryptoList = findAllLibCrypto();
|
||||||
|
|
||||||
for (const QString &crypto : cryptoList) {
|
for (const QString &crypto : cryptoList) {
|
||||||
|
#ifdef Q_OS_DARWIN
|
||||||
|
// Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI
|
||||||
|
if (crypto.endsWith("libcrypto.dylib"))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
libcrypto->setFileNameAndVersion(crypto, -1);
|
libcrypto->setFileNameAndVersion(crypto, -1);
|
||||||
if (libcrypto->load()) {
|
if (libcrypto->load()) {
|
||||||
QFileInfo fi(crypto);
|
QFileInfo fi(crypto);
|
||||||
|
@ -685,6 +685,11 @@ LoadedOpenSsl loadOpenSsl()
|
|||||||
const QStringList cryptoList = findAllLibCrypto();
|
const QStringList cryptoList = findAllLibCrypto();
|
||||||
|
|
||||||
for (const QString &crypto : cryptoList) {
|
for (const QString &crypto : cryptoList) {
|
||||||
|
#ifdef Q_OS_DARWIN
|
||||||
|
// Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI
|
||||||
|
if (crypto.endsWith("libcrypto.dylib"))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
libcrypto->setFileNameAndVersion(crypto, -1);
|
libcrypto->setFileNameAndVersion(crypto, -1);
|
||||||
if (libcrypto->load()) {
|
if (libcrypto->load()) {
|
||||||
QFileInfo fi(crypto);
|
QFileInfo fi(crypto);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user