App Store Rejection for using libcrypto.dylib

Now I have tried all dylib releases 0.9.8, 1.0, 1.0.1, 35, 41 etc. The result is, that the application doesn’t run when it was complied with Xojo 2021R1, and the error is the same:

Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

Also I have tried this application on macOS 10.15.6 and the error is also the same.

When I build my application with the same source code and Xojo 2020R2.1, the application runs without any error.

That error message seems to indicate you’re still referencing the unversioned shared copy of libcrypto, which as I already mentioned above, Apple does not want you to do.

Have you tried building and bundling libcrypto into your application like Apple recommends?

1 Like

That’s because 2021r1 is linking your applications against the macOS 11 SDK (Intel & ARM), whereas 2020r2 is linking Intel-builds against an older macOS SDK (but ARM of course having to use macOS 11 SDK).

It seems to me that it’s just no longer allowed to load an unversioned (libcrypto) dylib when using the macOS 11 SDK.

Ah, you’ve just written that, too - but posted before me :slight_smile:

Example:

Const cryptoLib = "/usr/lib/libcrypto.dylib"

Declare Function SSLeay_version Lib cryptoLib (i As Integer) As CString
Dim v As String = SSLeay_version(0)
Break

This works just fine with Xojo 2020r2 on macOS 11.2
It crashes when compiled with 2021r1 (as explained and shown in posts above).

If I specify a version for the dylib, then I get the following results with 2021r1 on macOS 11.2:

Const cryptoLib = "/usr/lib/libcrypto.dylib"
'Result: ___crash___

Const cryptoLib = "/usr/lib/libcrypto.0.9.8.dylib"
'Result: v = OpenSSL 0.9.8zh 14 Jan 2016

Const cryptoLib = "/usr/lib/libcrypto.35.dylib"
'Result: v = LibreSSL 2.2.9

Const cryptoLib = "/usr/lib/libcrypto.41.dylib"
'Result: v = LibreSSL 2.5.5

And just fyi… Xojo 2020r2 on macOS 11.2 will get you this:

Const cryptoLib = "/usr/lib/libcrypto.dylib"
'Result: v = LibreSSL 2.2.9

We do :wink:

And I’d encourage everyone to do so… Otherwise you have a dependency on it’s availablity by the OS. And that might change with every OS version. So your app might break with an updated macOS version. At the very least you’d need proper checks and error handling.

Trying to sum up the possible issues mentioned in this Thread:

  • Using /usr/lib/libcrypto.dylib is no longer possible with Xojo 2021r1 (and most likely 2020r2 and macOS-ARM64)
    It seems to me that the newest macOS SDK enforces this. But there might also come a macOS update preventing that sooner or later for existing apps - one never knows…
  • /usr/lib/libcrypto.0.9.8.dylib is not available for macOS-ARM64 - meaning Apple doesn’t supply it with macOS 11.
    Not surprising that Apple hasn’t compiled and provided such an old library for their newest target…

So either we have to use a specific version which means error-checking if it exists (and then use/try other versions), as not all OS versions have the same lib-versions available. And it might change anytime since it’s out of our control.

Or (such as Apple seems to recommend) build an own .dylib and bundle it within the application. Which certainly has the benefit that one knows exactly which version it is - and can make sure the Declares work.

Again not quite surprising… OpenSSL 0.9.8 and 1.1.1 have quite some differences in the API. From that point of view, I understand Apple wants us to link against a specific version.

1 Like