1

I am developing an Android 32-bit app in Delphi. I need to use OpenSSL libraries in my app in order to connect to an MQTT broker.

I am using OpenSSL 1.0.2t armeabi-v7a libcrypto.a and libssl.a static libraries. Through Delphi's Deployment Manager, I deploy them into my project's library\lib\armeabi-v7a folder for both Debug and Release configurations, but I keep getting a "Could not load SSL Library" error when I try to connect to the broker testing the app.

I also tried deploying the armeabi version of libcrypto.a and libssl.a into library\lib\armeabi but I'm still getting the same error.

After compiling the project, I checked that the libraries were succesfully deployed in the project folders (which they were). The target device Android version is Android 11. Is the problem with the library version? Or am I missing another configuration step in Delphi?

I've tried using OpenSSL 1.0.2o and 1.0.2n versions of the static libraries, but still no luck.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Miguel Mar
  • 11
  • 1

1 Answers1

1

The error you are seeing is from Indy. The deployment is likely putting the lib files in a place that Indy can't find by default, or doesn't have access to. You may need to tell the deployment to put the files somewhere more accessible, and then tell Indy at runtime where the lib files are located after they have been deployed. You can use the IdOpenSSLSetLibPath() function in the IdSSLOpenSSLHeaders unit for that purpose.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 1
    Hello @Remy Lebeau, I managed to fix the problem. Instead of using libcrypto.a and libssl.a y tried using libssl.so and libcrypto.so . That made it work. – Miguel Mar Apr 04 '22 at 00:46