Jump to content
2nd-Snoopy

Class TSslHttpCli not found - DELPHI5

Recommended Posts

Hello. I have downloaded OverbyteIcsV5.zip from Overbyte-Site. For many reasons I cannot migrate my program(s) to DELPHI6 or higher. Therefore I still have to use DELPHI5 :-(
I have extracted from this zip-file only  'DELPHI' and 'VC32'. When opening HttpTst1.dpr I get the error 'Class TSslHttpCli not found'.
After this I can compile the project and run the program. But the mainform 'HttpsTstForm' is not available in Desingmode (Editor).
I have no idea what is wrong in the sourcecode.  I think a following error is, that the program gets an exception, when trying writing the INI-File in procedure THttpsTstForm.FormClose.

Can someone help me in this (not for me) obsolete sourcecode?
 

Share this post


Link to post

As far as I remember, the very old ICS which still support Delphi 5 lacks SSL although I'm not sure.

Why can't you upgrade to latest Delphi version? If it is for hobby or small business, you can use the Community Edition which is free.

Unless you use old components for which you don't have the source, it is not that difficult to port Delphi 5 to latest Delphi version.

 

Share this post


Link to post

The version of OpenSSL that ICS v5 used will not work today, the protocols have changed since then. 

 

It may be worth trying to build a subset of ICS v8 with Delphi 5, language wise it was really 64-bit streams I think which you could change, not sure when Int64 came in, that would be harder.  There are also minimum version checks you'd have to disable.  Or get Delphi 7 or 2007 and upgrade your project, fewer changes and testing than unicode versions, unless a simple project.

 

Angus

 

Share this post


Link to post
10 hours ago, FPiette said:

As far as I remember, the very old ICS which still support Delphi 5 lacks SSL although I'm not sure.

 

Thank You Francois.

Sorry, my fault. Of course the sample program I compiled is HttpsTst.dpr. This sample I am able to compile and run in DELPHI5 (but without success to read a real https-URL). There is a problem in sourcecode which avoids showing the mainform in designmode.

Do You think, that a program of 2007 using this ICS-https does not run today anymore, caused by changing the SSL-version?

 

Matthias

Share this post


Link to post

Agnus, perhaps I will try this way. Thank You.

Another general question: When a certificate expires, than a https-Get will not have success any more. What happens with distributed copies of my program.

Or in general: what has a program to do, when installed on another PC? Does it run with my certificates or has the user generate his own certificate.

You see: I have no knowledge of SSL ...

Edited by 2nd-Snoopy

Share this post


Link to post
23 minutes ago, 2nd-Snoopy said:

There is a problem in sourcecode which avoids showing the mainform in designmode.

Not sure about the cause because you did not told us which exact error message you have.

 

Maybe you forgot to install ICS component package.

 

Or you did but you opened the project BEFORE having installed ICS and when the IDE complain about missing component you answered "ignore". You shoulg have answered "cancel" because "ignore" will remove the missing component and open the form.

26 minutes ago, 2nd-Snoopy said:

Do You think, that a program of 2007 using this ICS-https does not run today anymore, caused by changing the SSL-version?

It will still run if you install the old OpenSSL version of that time. But it is likely that webserver you'll try to connect to will refuse the connection because it sees an outdated SSL version.

Share this post


Link to post

Not sure which certificates you are referring to, HTTPS clients receive certificates from servers, and can check they are legitimate, but can accept them anyway.  In rare high security cases HTTPS clients have a certificate to prove their identity issued by a company they want to access, mostly VPNs, but any you had 13 years ago will be useless now.

 

Angus

 

Share this post


Link to post
13 hours ago, FPiette said:

Maybe you forgot to install ICS component package.

Yes, Thank You. This would be the reason. I did not install the new version of ICS coponents. I tried, but I got the error that

Unit 'HttpProt' already exists in an other package (due to the installation of an even elder version of ICS).

At the moment I can not remove or replace my old componet of HttpCli, because many years ago I did some modifications in HttpProt.pas which I barely can remember und which will go lost. (Anyway I can recompile the old version:classic_smile:).

 

It need some more investigation or merge TSslHttpCli into my old version of HttpPror.pas.

Thank You

  Matthias

Share this post


Link to post
12 minutes ago, 2nd-Snoopy said:

It need some more investigation or merge TSslHttpCli into my old version of HttpPror.pas.

Bad idea IMO.

Quote

I did some modifications in HttpProt.pas

That was a bad idea. Never do that for any component. Always use inheritance for that (Create you own component inheriting from the existing). If you can't do what you need in the inherited class, for example because a method is not virtual or private or similar, then contact author to request a small change.

 

You should really get rid of the old Delphi 5, and anything else but the latest from Embarcadero. You have not answered my question about why you can't upgrade.

Share this post


Link to post
11 hours ago, Angus Robertson said:

HTTPS clients receive certificates from servers, and can check they are legitimate, but can accept them anyway. 

Hi Agnus. THX. Still trying to understand SSL: Do I need a own certificate when I can accept the certificate of the server anyway? My program needs not to validate a certificate. But I understand: if the stream is encrypted I need to decrypt the stream ...🤔

 

Share this post


Link to post

A certificate is used to make sure someone is really what he pretend to be. For example you want to make sure that when you connect to your bank, it is really your bank. You verify this by the certificate your bank send in the SSL session. That certificate is signed by a "certification authority" (Or a chain of such certification authorities) that you trust.

 

A client can also use a certificate to prove he is the one he pretend to be. The server will check the certificate to see if it is one that he expect.

 

Usually, client don't use certificate except for some VPN. Most banks don't care about your certificate, if any, because they use other authentication methods such as a physical digipass.

 

No matter if a certificate is used or not, SSL (Or TLS) communication is stronglly crypted.

 

Quote

Do I need a own certificate when I can accept the certificate of the server anyway?

Now that I have introduced the subject, I can answer: As a client you only need a certificate if the server requires a certificate.

 

Share this post


Link to post
10 minutes ago, 2nd-Snoopy said:

Still trying to understand SSL

I made SSL part of ICS after reading the book "Network Security with OpenSSL". This is now an old book, but all the concepts and most of programming is still valid today.

Share this post


Link to post

Thank You both for Your patience.

Finally - if You are interested - I want explain why I did not migrate to DELPHI6 or higher.

I have two main applications (programs). These are Database applications with my own database, realized with DELPHI TOOLBOX (You remember?) which contained a set of BTREE-functions and procedures. All this with ansi strings.

The position and size of controls and edit-fields etc are calculated in my program in dependence of the charactersize of the selected Charset. When compiled with DELPHI6 nearly all positions of these controls didn't fit any more. That means the metric and some related metric-functions did not give the same result as in DELPHI5. And I encountered a further problem: DELPHI6 was the first version where the type STRING now was UNICODE by default.  On the quick I found no easy way to switch the default type to ANSI-String. I was afraid for a lot of problems with my ANSI-String-BTREE-Database. For my simple 'straight-for' programming I saw (till today) no need to change to DELPHI6 under these circumstances.

 

Perhaps for my third application (Viewing Webcam-Images) I will install DELPHI2006 a start a new run-up ....

Share this post


Link to post
7 minutes ago, 2nd-Snoopy said:

DELPHI6 was the first version where the type STRING now was UNICODE by default

That is wrong. Delphi 2009 introduced Unicode.

 

Quote

my own database, realized with DELPHI TOOLBOX (You remember?) which contained a set of BTREE-functions and procedures. All this with ansi strings.

This doesn't prevent compiling it with current Delphi version. You just have to replace in the source code "String" by "AnsiString". That's it !

Of course current Delphi still support ANSI strings (Data type is AnsiString and AnsiChar, String and Char are mapped to Unicode.

Anyway, looking at Delphi Toolbox I see it has been maintained and support Delphi 10.3 which is the latest Delphi Community Editon.

 

Quote

The position and size of controls and edit-fields etc are calculated in my program in dependence of the charactersize of the selected Charset. When compiled with DELPHI6 nearly all positions of these controls didn't fit any more.

I don't understand that. Could you give a simple trivial example showing the problem?

 

Share this post


Link to post
3 hours ago, FPiette said:

That is wrong. Delphi 2009 introduced Unicode

? I am very confused now. I think I should retire.

 

Share this post


Link to post

The most common reason for altering HttpPror.pas was to add extra HTTP headers that the early versions did not support directly, although they could be added using events.  Typically authentication headers.  But a lot has changed over the years, there are many new authentication methods supported and a new property ExtraHeaders for unusual headers.  

 

Angus

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×