Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Using OpenSSL with Indy on Android 6



Permlink Replies: 11 - Last Post: Feb 2, 2017 11:02 AM Last Post By: Synaptica Srl U...
Remy Lebeau (Te...


Posts: 8,839
Registered: 12/23/01
Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 12, 2016 12:09 PM
OpenSSL 1.0.2g binaries for Android are now available in the Embarcadero
Attachments forum (hopefully soon to be posted on Indy's http://indy.fulgan.com
mirror as well):

https://forums.embarcadero.com/thread.jspa?threadID=211147

Then, to make Indy load OpenSSL instead of Google's new BoringSSL library
(OpenSSL replacement), follow these steps:

1. Add the 2 .so files to your project deployment and set them to deploy
to the .\assets\internal\ folder

2. add the System.StartupCopy unit as the first unit in your DPR's uses clause.

3. call IdOpenSSLSetLibPath(TPath.GetDocumentsPath) at app startup.

--
Remy Lebeau (Indy Team)
Dave Nottage

Posts: 1,692
Registered: 1/7/00
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 13, 2016 3:17 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

OpenSSL 1.0.2g binaries for Android are now available in the Embarcadero
Attachments forum (hopefully soon to be posted on Indy's http://indy.fulgan.com
mirror as well):

Thanks, Remy!

I haven't had a chance to check it out (my Android 6 phone has gone missing, and I need to re-setup an emulator if I'm
going to use one), but I was near the point of moving over to ICS, which I did not want to do :-)

--
Dave Nottage [TeamB]
Hint, tips and tricks at: http://www.delphiworlds.com/blog
bilgi bilgi

Posts: 5
Registered: 7/3/02
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 14, 2016 5:56 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
i tested delphi 10 seatle with android 5 device, but it doesnt change any thing. It using default openssl so files.

Remy Lebeau (TeamB) wrote:
OpenSSL 1.0.2g binaries for Android are now available in the Embarcadero
Attachments forum (hopefully soon to be posted on Indy's http://indy.fulgan.com
mirror as well):

https://forums.embarcadero.com/thread.jspa?threadID=211147

Then, to make Indy load OpenSSL instead of Google's new BoringSSL library
(OpenSSL replacement), follow these steps:

1. Add the 2 .so files to your project deployment and set them to deploy
to the .\assets\internal\ folder

2. add the System.StartupCopy unit as the first unit in your DPR's uses clause.

3. call IdOpenSSLSetLibPath(TPath.GetDocumentsPath) at app startup.

--
Remy Lebeau (Indy Team)
Remy Lebeau (Te...


Posts: 8,839
Registered: 12/23/01
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 9:47 AM   in response to: bilgi bilgi in response to: bilgi bilgi
Hello bilgi,

i tested delphi 10 seatle with android 5 device, but it doesnt
change any thing. It using default openssl so files.

I assume you mean Android 6. BoringSSL is not on Android 5.

Are you using the OpenSSL .so files that have been posted to the Attachments
forum? Did you follow the steps to deploy the .so files to the app's "assets\internal"
folder and use the StartupCopy unit before calling IdOpenSSLSetLibPath()?

--
Remy Lebeau (TeamB)
bilgi bilgi

Posts: 5
Registered: 7/3/02
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 1:06 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Yes I used attached so files, and deploy with assets\internal and added StartupCopy and called IdOpenSSLSetLibPath but Android 5 device didnt use deployed files. It used default openssl library. I tested apk file android 6 device and it used default library.
I tested FileExists command with deplıyed path and FileExists returns true.
I used blank project
I think your solution only work Andorid 10.1 Berlin? Or Special Indy Svn Build?


Remy Lebeau (TeamB) wrote:
Hello bilgi,

i tested delphi 10 seatle with android 5 device, but it doesnt
change any thing. It using default openssl so files.

I assume you mean Android 6. BoringSSL is not on Android 5.

Are you using the OpenSSL .so files that have been posted to the Attachments
forum? Did you follow the steps to deploy the .so files to the app's "assets\internal"
folder and use the StartupCopy unit before calling IdOpenSSLSetLibPath()?

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 8,839
Registered: 12/23/01
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 1:36 PM   in response to: bilgi bilgi in response to: bilgi bilgi
bilgi wrote:

Yes I used attached so files, and deploy with assets\internal and
added StartupCopy and called IdOpenSSLSetLibPath but Android 5
device didnt use deployed files.

Again, do you really mean Android 5 or *6*? Indy's issus with OpenSSL
are mostly on Android 6 due to Google no longer supporting OpenSSL. Things
should be working fine on Android 5.

It used default openssl library.

And you know this how...?

I think your solution only work Andorid 10.1 Berlin?

My solution is not specific to any particular Delphi version.

Or Special Indy Svn Build?

No. All Indy versions work the same way in regards to how Indy loads OpenSSL.

--
Remy Lebeau (TeamB)
bilgi bilgi

Posts: 5
Registered: 7/3/02
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 2:21 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
bilgi wrote:

Yes I used attached so files, and deploy with assets\internal and
added StartupCopy and called IdOpenSSLSetLibPath but Android 5
device didnt use deployed files.

Again, do you really mean Android 5 or *6*? Indy's issus with OpenSSL
are mostly on Android 6 due to Google no longer supporting OpenSSL. Things
should be working fine on Android 5.

Yes, I know. But I have an Andorid 5 device, I am testing with it. Android 5 does not use deployed so files. And I send my friend to test andorid 6 device. And android 6 doesnot use deployed library. Both using default library.


It used default openssl library.

And you know this how...?

checking with ShowMessage(OpenSSLVersion); command.


I think your solution only work Andorid 10.1 Berlin?

My solution is not specific to any particular Delphi version.

Or Special Indy Svn Build?

No. All Indy versions work the same way in regards to how Indy loads OpenSSL.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 8,839
Registered: 12/23/01
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 2:54 PM   in response to: bilgi bilgi in response to: bilgi bilgi
bilgi wrote:

It used default openssl library.
And you know this how...?
checking with ShowMessage(OpenSSLVersion); command.

Then your device is likely pre-loading its default OpenSSL library at device
startup, and mapping all subsequent requests of the same .so filename (regardless
of path) to that pre-loaded instance. In which case, there is nothing you
can do about that, unles you recompile OpenSSL with different filenames (not
easy to do).

--
Remy Lebeau (TeamB)
bilgi bilgi

Posts: 5
Registered: 7/3/02
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 16, 2016 2:28 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
I using following code. With two so files and true deployment settings.

program Project3;
uses
System.StartUpCopy,
FMX.Forms,
Unit2 in 'Unit2.pas' {Form2},
IdSSLOpenSSLHeaders
{$IFDEF IOS}
IdSSLOpenSSLHeaders_Static
{$ENDIF };

{$R *.res}

begin

IdOpenSSLSetLibPath(system.ioutils.TPath.GetDocumentsPath);//no effect

Application.Initialize;

IdOpenSSLSetLibPath(system.ioutils.TPath.GetDocumentsPath);//no effect

Application.CreateForm(TForm2, Form2);
Application.Run;
end.


unit Unit2;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,IdSSLOpenSSL,system.ioutils,IdSSLOpenSSLHeaders
{$IFDEF IOS}
IdSSLOpenSSLHeaders_Static
{$ENDIF };

type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.fmx}

procedure TForm2.FormCreate(Sender: TObject);
begin
IdOpenSSLSetLibPath(system.ioutils.TPath.GetDocumentsPath);//no effect
Showmessage(OpenSSLVersion);//opensll 1.0.1k-fips 8 Jan 2015
if fileexists( tpath.combine(system.ioutils.TPath.GetDocumentsPath,'libssl.so'))
then
showmessage('yes')//say yes
else
showmessage('no');
ShowMessage(WhichFailedToLoad);//empty
end;

end.
bilgi bilgi

Posts: 5
Registered: 7/3/02
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2016 5:28 PM   in response to: bilgi bilgi in response to: bilgi bilgi
bilgi bilgi wrote:
Yes I used attached so files, and deploy with assets\internal and added StartupCopy and called IdOpenSSLSetLibPath but Android 5 device didnt use deployed files. It used default openssl library. I tested apk file android 6 device and it used default library.

I tested again with latest openssl so files and results are:

android 5 using default open ssl files. (no problem)
android 6 using deployed open ssl files. (most device is working, but some device not)

thank you Remy

Mikel Kelvin

Posts: 1
Registered: 11/20/16
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2016 9:46 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
OpenSSL 1.0.2g binaries for Android are now available in the Embarcadero
Attachments forum (hopefully soon to be posted on Indy's http://indy.fulgan.com
mirror as well):

https://forums.embarcadero.com/thread.jspa?threadID=211147

Then, to make Indy load OpenSSL instead of Google's new BoringSSL library
(OpenSSL replacement), follow these steps:

1. Add the 2 .so files to your project deployment and set them to deploy
to the .\assets\internal\ folder

2. add the System.StartupCopy unit as the first unit in your DPR's uses clause.

3. call IdOpenSSLSetLibPath(TPath.GetDocumentsPath) at app startup.

--
Remy Lebeau (Indy Team)

Thank you for what you have written it, but I did not get it all started. Can anyone put this project .Ya really need this. Thank you so much!
Synaptica Srl U...

Posts: 14
Registered: 6/26/08
Re: Using OpenSSL with Indy on Android 6
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 2, 2017 11:02 AM   in response to: Mikel Kelvin in response to: Mikel Kelvin
Mikel Kelvin wrote:
Remy Lebeau (TeamB) wrote:
OpenSSL 1.0.2g binaries for Android are now available in the Embarcadero
Attachments forum (hopefully soon to be posted on Indy's http://indy.fulgan.com
mirror as well):

https://forums.embarcadero.com/thread.jspa?threadID=211147

Then, to make Indy load OpenSSL instead of Google's new BoringSSL library
(OpenSSL replacement), follow these steps:

1. Add the 2 .so files to your project deployment and set them to deploy
to the .\assets\internal\ folder

2. add the System.StartupCopy unit as the first unit in your DPR's uses clause.

3. call IdOpenSSLSetLibPath(TPath.GetDocumentsPath) at app startup.

--
Remy Lebeau (Indy Team)

Thank you for what you have written it, but I did not get it all started. Can anyone put this project .Ya really need this. Thank you so much!


me too .... are a couple of days that i try all but with no success, on my Galaxy TAB A6, android6 i have always the same message "Could not open SSL library"

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02