Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Android 6 OpenSSL



Permlink Replies: 11 - Last Post: Jul 4, 2016 11:45 AM Last Post By: Remy Lebeau (Te... Threads: [ Previous | Next ]
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Android 6 OpenSSL
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2016 6:10 AM
Hi all,

I am trying to use OpenSSL with Indy on Android 6. I found information which steps should I take:

1. Add the libssl.so, libcrypto.so files to your project deployment and set them to deploy
to the .\assets\internal\

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

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

but it does not work for me because Indy's WhichFailedToLoad() function gives me "SSLv2_method,SSLv2_server_method,SSLv2_client_method". I think I need to use different libssl.so, libcrypto.so, but nothing work. Maybe I am doing something wrong.
I am using C++ RAD Studio 10 Seattle.

Edited by: Dagmara Niedzwiecka on Jun 24, 2016 6:11 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2016 9:38 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

it does not work for me because Indy's WhichFailedToLoad()
function gives me "SSLv2_method,SSLv2_server_method,SSLv2_client_method".

You are using an older version of Indy that still requires those functions
to be present in OpenSSL. Due to last year's POODLE attacks on OpenSSL,
Indy was updated 9 months ago to allow those functions to be optional going
forward:

OpenSSL changes
http://indyproject.org/sockets/blogs/changelog/20150907.EN.aspx

I think I need to use different libssl.so, libcrypto.so

Yes. The latest OpenSSL binaries that are compatible with Android 6 are available
here:

http://indy.fulgan.com/SSL/AndroidOpenssl1.0.2h.zip

But you also need to upgrade to the latest version of Indy itself, as there
have been other changes made to support OpenSSL on Android 6.

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Re: Android 6 OpenSSL [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 28, 2016 6:48 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB)
Remy Lebeau (TeamB) wrote:
Dagmara wrote:

it does not work for me because Indy's WhichFailedToLoad()
function gives me "SSLv2_method,SSLv2_server_method,SSLv2_client_method".

You are using an older version of Indy that still requires those functions
to be present in OpenSSL. Due to last year's POODLE attacks on OpenSSL,
Indy was updated 9 months ago to allow those functions to be optional going
forward:

OpenSSL changes
http://indyproject.org/sockets/blogs/changelog/20150907.EN.aspx

I think I need to use different libssl.so, libcrypto.so

Yes. The latest OpenSSL binaries that are compatible with Android 6 are available
here:

http://indy.fulgan.com/SSL/AndroidOpenssl1.0.2h.zip

But you also need to upgrade to the latest version of Indy itself, as there
have been other changes made to support OpenSSL on Android 6.

--
Remy Lebeau (TeamB)

Thank you. I tried upgrade Indy by using the instructions from webside http://www.indyproject.org/Sockets/Docs/Indy10Installation. I installed dclIndyCore230.bpl and dclIndyProtocols230.bpl, but when I want to compile my program I am getting messages to browse libraries:

Unable to find static library: libIndyProtocols230.a.
Unable to find static library: libIndySystem230.a.
Unable to find static library: libIndyCore230.a.

I can't find them, and I can't build the program. Many errors are appearing then.

Edited by: Dagmara Niedzwiecka on Jun 28, 2016 6:48 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 28, 2016 10:21 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

Thank you. I tried upgrade Indy by using the instructions from webside
http://www.indyproject.org/Sockets/Docs/Indy10Installation. I
installed dclIndyCore230.bpl and dclIndyProtocols230.bpl, but when I
want to compile my program I am getting messages to browse libraries:

Unable to find static library: libIndyProtocols230.a. Unable to find
static library: libIndySystem230.a. Unable to find static library:
libIndyCore230.a.

I can't find them, and I can't build the program. Many errors are
appearing then.

Sounds like you did not compile Indy Android. It is not enough to just install
it into the IDE itself, you still have to compile it for the individual platforms
that you want to use it on. Did you do that?

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Re: Android 6 OpenSSL [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2016 3:26 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Dagmara wrote:

Thank you. I tried upgrade Indy by using the instructions from webside
http://www.indyproject.org/Sockets/Docs/Indy10Installation. I
installed dclIndyCore230.bpl and dclIndyProtocols230.bpl, but when I
want to compile my program I am getting messages to browse libraries:

Unable to find static library: libIndyProtocols230.a. Unable to find
static library: libIndySystem230.a. Unable to find static library:
libIndyCore230.a.

I can't find them, and I can't build the program. Many errors are
appearing then.

Sounds like you did not compile Indy Android. It is not enough to just install
it into the IDE itself, you still have to compile it for the individual platforms
that you want to use it on. Did you do that?

--
Remy Lebeau (TeamB)

You are right, I did not compile IndySystem230, IndyCore230 and IndyProtocols230 in Android target platform. Still have a problem, IndySystem230 compiled correctly but IndyCore230 did not find IndySystem230 :
[DCC Fatal Error] IndyCore230.dpk(47): E2202 Required package 'IndySystem230' not found;

If I tried to change output c++ directories for IndySystem230, but the error still appearing. It looks like the files for Android have not created (output folders are empty)

I really do not know how to fix that ;/

Edited by: Dagmara Niedzwiecka on Jun 29, 2016 6:48 AM

Edited by: Dagmara Niedzwiecka on Jun 29, 2016 8:10 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2016 9:16 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

[DCC Fatal Error] IndyCore230.dpk(47): E2202 Required package
'IndySystem230' not found;

That is a search path issue, not a coding issue.

If I tried to change output c++ directories for IndySystem230, but
the error still appearing. It looks like the files for Android have not
created (output folders are empty)

Did you check if the IDE is outputting the files to a different folder then
the one you are expecting? Check the other folders in the output paths,
or use a tool like SysInternals ProcessMonitor to see exactly where the IDE
is writing them.

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Re: Android 6 OpenSSL [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 30, 2016 7:21 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

Did you check if the IDE is outputting the files to a different folder then
the one you are expecting? Check the other folders in the output paths,
or use a tool like SysInternals ProcessMonitor to see exactly where the IDE
is writing them.

--
Remy Lebeau (TeamB)

I had to browse path in Delphi Compiler -> DCP output directory because it did not create libraries for Android. After that now Indy is working for Android platform. but still get "SSLv2_method,SSLv2_server_method,SSLv2_client_method" in my program. What can be a problem? Maybe I did not delete everything correctly on the beginning? I used OpenSSL binaries from your link: http://indy.fulgan.com/SSL/AndroidOpenssl1.0.2h.zip
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 30, 2016 9:39 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

I had to browse path in Delphi Compiler -> DCP output directory
because it did not create libraries for Android. After that now Indy
is working for Android platform. but still get
"SSLv2_method,SSLv2_server_method,SSLv2_client_method"
in my program.

Then you are not actually using the latest Indy, because those SSLv2 functions
ARE NO LONGER REQUIRED and WILL NOT be reported by WhichFailedToLoad() anymore.

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Re: Android 6 OpenSSL [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2016 7:30 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Then you are not actually using the latest Indy, because those SSLv2 functions
ARE NO LONGER REQUIRED and WILL NOT be reported by WhichFailedToLoad() anymore.

My Indy components show Indy version 10.6.2.5298. In the IdSSLOpenSSLHeaders.pas I can see added functions:

function IsOpenSSL_SSLv2_Available : Boolean;
function IsOpenSSL_SSLv3_Available : Boolean;
function IsOpenSSL_SSLv23_Available : Boolean;
function IsOpenSSL_TLSv1_1_Available : Boolean;
function IsOpenSSL_TLSv1_2_Available : Boolean;
function IsOpenSSL_DTLSv1_Available : Boolean;

I have downloaded Indy by using link https://svn.atozed.com:444/svn/Indy10. Go to Tag->Indy 10.6.2 - Seattle Upd1. Where I find the latest version of Indy?because I think I am doing something wrong;/

Edited by: Dagmara Niedzwiecka on Jul 1, 2016 7:34 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit] [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2016 10:47 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

My Indy components show Indy version 10.6.2.5298.

The current version is 10.6.2.5362. The last number is the SVN revision.
The SSLv2, SSLv3, SSLv23, and TLSv1 functions were all made optional in
revision 5303 (TLSv1_1 and TLSv1_2 were already optional earlier).

In the IdSSLOpenSSLHeaders.pas I can see added functions:

function IsOpenSSL_SSLv2_Available : Boolean;
function IsOpenSSL_SSLv3_Available : Boolean;
function IsOpenSSL_SSLv23_Available : Boolean;
function IsOpenSSL_TLSv1_1_Available : Boolean;
function IsOpenSSL_TLSv1_2_Available : Boolean;
function IsOpenSSL_DTLSv1_Available : Boolean;

Those functions were added in revision 5303. So, you have the source code
for an updated Indy version, but you don't actually have that version installed
in the IDE correctly, if the components are reporting revision 5298.

I have downloaded Indy by using link
https://svn.atozed.com:444/svn/Indy10. Go to Tag->Indy 10.6.2 -
Seattle Upd1.

That tagged version of Indy shipped with Update 1 of RAD Studio 10.0 Seattle,
but that is not the latest version that is available in SVN. The "10.6.2
- Berlin RTM" tagged version shipped with the RTM of RAD Studio 10.1 Berlin,
and the current SVN snapshot is newer than that.

Where I find the latest version of Indy?

From the same SVN server, just don't use the tagged versions, use the trunk
version instead.

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Re: Android 6 OpenSSL [Edit] [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 4, 2016 7:10 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank very much for your help! Now is working! I had to add dclIndyCore230.bpl, dclIndyProtocols230.bpl, IndyCore230.bpl, IndySystem230.bpl and IndyProtocols230.bpl to bin folder, because when I tried install dclIndyCore230.bpl or dclIndyProtocols230.bpl I was having errors that some bpl is missing. Thanks!
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Android 6 OpenSSL [Edit] [Edit] [Edit] [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 4, 2016 11:45 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

I had to add dclIndyCore230.bpl, dclIndyProtocols230.bpl,
IndyCore230.bpl, IndySystem230.bpl and IndyProtocols230.bpl
to bin folder, because when I tried install dclIndyCore230.bpl or
dclIndyProtocols230.bpl I was having errors that some bpl is
missing.

You are not allowed to put custom files in the IDE's \bin folder, that will
trigger its anti-piracy protection, which has an annoying side effect of
swapping the File|Save and File|Open menu actions (seriously).

The BPLs should be placed in a folder that is on the IDE's search path instead.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02