Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Could not load SSL library
#1
Hi, when I try to access a url with https the following error occurs: Could not load SSL library. But this error only occurs when I compile my app for android 64-bit, 32-bit works well.
I am using delphi 10.3.3 and AndroidOpenssl1.0.2h

Some idea?
Thanks
Reply
#2
(11-10-2020, 11:46 PM)alpires2000 Wrote: Hi, when I try to access a url with https the following error occurs: Could not load SSL library.

What does Indy's WhichFailedToLoad() function report after the error has occured?

(11-10-2020, 11:46 PM)alpires2000 Wrote: But this error only occurs when I compile my app for android 64-bit, 32-bit works well.

You need a 64bit version of the OpenSSL library files. You can't use a 32bit library in a 64bit app, and vice versa.

(11-10-2020, 11:46 PM)alpires2000 Wrote: I am using delphi 10.3.3 and AndroidOpenssl1.0.2h

I believe that zip contains only 32bit files. You are going to have to obtain 64bit files from somewhere else, the Indy repo doesn't have any OpenSSL 64bit library files for Android at this time.

Reply
#3
(11-10-2020, 11:46 PM)alpires2000 Wrote: Hi, when I try to access a url with https the following error occurs: Could not load SSL library. But this error only occurs when I compile my app for android 64-bit, 32-bit works well.
I am using delphi 10.3.3 and AndroidOpenssl1.0.2h

Some idea?
Thanks

Hello.

I have published x64 prebuilt OpenSSL libraries for Android at my github: Prebuilt-OpenSSL-1.0.2f-Android
Reply
#4
(12-07-2020, 07:56 PM)dfe.prado Wrote: I have published x64 prebuilt OpenSSL libraries for Android at my github: Prebuilt-OpenSSL-1.0.2f-Android

Why 1.0.2f and not 1.0.2u (the last version released in the 1.0.2 series)?

Reply
#5
(12-07-2020, 09:45 PM)rlebeau Wrote:
(12-07-2020, 07:56 PM)dfe.prado Wrote: I have published x64 prebuilt OpenSSL libraries for Android at my github: Prebuilt-OpenSSL-1.0.2f-Android

Why 1.0.2f and not 1.0.2u (the last version released in the 1.0.2 series)?

Just my preference to pass in Google Play Store validation. Anyone can download the official sources of any version from openssl website and rerun the build process as I mentioned in the repo's readme.
Reply
#6
(12-08-2020, 01:41 PM)dfe.prado Wrote:
(12-07-2020, 09:45 PM)rlebeau Wrote:
(12-07-2020, 07:56 PM)dfe.prado Wrote: I have published x64 prebuilt OpenSSL libraries for Android at my github: Prebuilt-OpenSSL-1.0.2f-Android

Why 1.0.2f and not 1.0.2u (the last version released in the 1.0.2 series)?

Just my preference to pass in Google Play Store validation. Anyone can download the official sources of any version from openssl website and rerun the build process as I mentioned in the repo's readme.

Does these libs works only with android version before 6.0 on the OS level? I mean let's say I created an app that targets 5.1 and used these libs with indy will they work on an android device that runs an OS newer than 6.0 as well or will it just refuse it and demand that I use BoringSSL instead?
Reply
#7
(12-08-2020, 02:48 PM)Ahmed Sayed Wrote: Does these libs works only with android version before 6.0 on the OS level? I mean let's say I created an app that targets 5.1 and used these libs with indy will they work on an android device that runs an OS newer than 6.0 as well or will it just refuse it and demand that I use BoringSSL instead?

Prior to 6 Marshmallow Android does not have BoringSSL, so, it's safe to use SSL without this library (In my case, I use SSL to connect to MQTT brokers. I face no problem in Android 5, even if I dont ship this library - but my environment has an older version of OpenSSL as well). To Android 6+ this library works. 

My tests was made to Android 7 Nougat and Android 10 Pie with success. Google allow my app to be deployed to Play Store using this OpenSSL's version, but any other version higher than 1.0.2g should work.
Reply
#8
(12-08-2020, 02:48 PM)Ahmed Sayed Wrote: Does these libs works only with android version before 6.0 on the OS level? I mean let's say I created an app that targets 5.1 and used these libs with indy will they work on an android device that runs an OS newer than 6.0 as well or will it just refuse it and demand that I use BoringSSL instead?

It depends. I've seen reports where using OpenSSL libs works fine on some Android6+ devices, and I've seen reports where they don't work because Android pre-loads BoringSSL at startup which causes blockage of OpenSSL libs.

Reply
#9
(12-08-2020, 08:35 PM)rlebeau Wrote: It depends.  I've seen reports where using OpenSSL libs works fine on some Android6+ devices, and I've seen reports where they don't work because Android pre-loads BoringSSL at startup which causes blockage of OpenSSL libs.

Can you point me to some articles or links that shows how to do it or even test. I am working on a big project that should work on desktop and mobile phones using the same http clients. And this been driving me crazy for some time and I am not good with delphi to write or even modify existing ones to my preferences. I want to use indy because I can track progress of any download/upload operations and that I can cancel that operation in the middle of it. But because of indy SSL problems on android I can't use it. On the other hand TNetHTTPClient/Request components works with native http from the OS so they use BoringSSL by default but they don't support any of Indy nice features for tracking progress or canceling a request. And I am still using C++ Builder Berlin and I have to make this work somehow and I still can't decide which one to use or if their another third party lib that work better than both. 

I found a class inherited from TFileStream called TProgressFileStream and that solves the progress issue but still can't find a way to cancel the request on berlin. They have cancel in newer versions but they are unstable and can't be used at all for us at work. 

So if you please help me with some steps to achieve anything regarding this issue that will be great because this issue is really a show stopper for me. What I mean what version of openssl libs that works with android 6+ how can I load them into the app. I never done it manually I always use indy SSL components.
Thanks in advance
Reply
#10
(12-17-2020, 01:47 AM)Ahmed Sayed Wrote: Can you point me to some articles or links that shows how to do it or even test.

Sorry, but no, I cannot.

(12-17-2020, 01:47 AM)Ahmed Sayed Wrote: So if you please help me with some steps to achieve anything regarding this issue that will be great because this issue is really a show stopper for me. What I mean what version of openssl libs that works with android 6+ how can I load them into the app.

I don't have that information. This is hit-or-miss on which *specific devices* this works on, or does not work on. It is not just particular Android versions, but particular *manufacturer-specific* Android versions.

This is not likely to happen in Indy 10, but maybe in Indy 12 (Indy 11 will be a maintenance-only release, no new features), we can look into possibly utilizing higher-level platform-based socket APIs and move away from using lower-level Posix/BSD socket APIs. This should allow Indy to leverage Android/iOS built-in SSL/TLS functionality and not rely on OpenSSL anymore. But I imagine that would be a substantial effort to code for, and will likely have performance and threading issues when crossing over the Java/NDK boundary on Android.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)