Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Migrating TidHttp and SSL Delphi 7 do Delphi XE4/5/...


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jul 20, 2016 10:37 AM Last Post By: Remy Lebeau (Te...
Artur Dietrich

Posts: 1
Registered: 8/20/16
Migrating TidHttp and SSL Delphi 7 do Delphi XE4/5/...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 20, 2016 7:16 AM
Hello. First excuse me if I have posted in wrong location.

Hello! I have a longer functional application in Delphi7 using TidHttp and TidSSLIOHandlerSocket component
that downloads and Upload Files from a specific server. To download a file and for example, I call a URL that points
to a server that runs Apache Tomcat 7, which has a download Java Servlet and another upload Servlet. For routines
work in SSL it was necessary to copy the libeay32.dll and ssleay32.dll libraries. These SSL libraries are libraries
openssl version 0.9.6m (very old by the way) customized for the Indy Project, which comes with Delphi 7.

Below routine Download:

function download_file (dir_relativo, filename, destFileName: string; var msgerr: string): boolean;
var
buffer: TFileStream;
code: integer;
begin
download_file: = false;
Buffer: = TFileStream.Create (destFileName, fmCreate or fmShareDenyWrite);
msgerr: = '';
try
form1.IdHTTP1.Request.BasicAuthentication: = true;
form1.IdHTTP1.Request.UserName: = 'Commun';
form1.IdHTTP1.Request.Password: = ss2;
try
form1.idhttp1.get (url_base + 'DownloadFile filedir =' + dir_relativo + '& filename =' + filename, buffer);
finally
form1.idhttp1.Disconnect;
download_file: = true;
buffer.free;
end;
except
on E: EIdHTTPProtocolException do begin
code: = form1.idhttp1.ResponseCode;
msgerr: = 'Error: http response code' + IntToStr (code);
Logweb (param_entrada2_str +, 'Error:' + msgerr 'log.');
download_file: = false;
end;
end;

end;

Server Which files are downloaded runs on Windows Server 2003 Standard and Apache Tomcat 7.
It works perfectly with and without SSL. (Http: ...: 8080 // ... and https: // ...: 8443 / ...)

NOW THE PROBLEM:

I installed Apache Tomcat Server 7 with the "same settings on several Linux": Red Hat, Oracle Linux, CentOS, etc.
and when I use the URL with SSL to download the files I receive the message from the Delphi application:

Project xxxx.exe raised exception class EIdOSSLConnectError with message 'Error connecting with SSL' ...

A few important notes:

- Calling any browser download URL or other program other than the Delphi works ...
- Linux servers with the next version of openssl: 1.0.1e-42
- The current Windows 2003 server that works, does not have SSL explicitly installed, you should use any SSL library TOMCAT
- The SSL libraries on the side of clients are 0.9.6m version of Indy Project
- No SSL works normamente in LINUX also

I would like suggestions on how I can solve this problem to run the download with SSL on Linux.
Eg Other components, I have to change Delphi, etc?

Or,

As personally think that Delphi component is very old and is no longer compatible with the new versions of SSL, I ask:

Delphi XEn have TIDHttp and SSL components or similar so that I can carry with ease from Delphi 7 to Delphi XE ?

Can you give me some tips?

Thanks in Advance and Best Regards
Artur

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Migrating TidHttp and SSL Delphi 7 do Delphi XE4/5/...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 20, 2016 10:37 AM   in response to: Artur Dietrich in response to: Artur Dietrich
Artur wrote:

when I use the URL with SSL to download the files I receive the
message from the Delphi application:

Project xxxx.exe raised exception class EIdOSSLConnectError with
message 'Error connecting with SSL' ...

You are using Indy 9, which unfortunately does not provide detailed information
about OpenSSL errors. The error message above tells you that Indy could
not complete an SSL handshake with the server, but does not explain why.

You should consider upgrading to Indy 10. Amongst other things, it:

- does not custom DLLs anymore, it uses standard OpenSSL DLLs, including
the current OpenSSL 1.0.2h version.

- supports TLS 1.1 and TLS 1.2

- SSL exceptions provide error codes and error messages from OpenSSL itself.

Delphi XEn have TIDHttp and SSL components or similar so that I
can carry with ease from Delphi 7 to Delphi XE ?

Yes. Modern Delphi versions ship with Indy 10. If you stay with Delphi
7, you can download and install Indy 10 manually.

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

Server Response from: ETNAJIVE02