Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use SSL with Delphi yet still having a single exe

Tags:

dll

exe

delphi

indy

We use Indy and we need SSL eMail support in our app., however we need to have our application in a single .Exe.

We know that the default Indy handler requires to have the dlls in the path. Extracting the Dlls from one of the EXE's resources would be the last resort.

Any better ideas?

like image 328
John Thomas Avatar asked Nov 19 '09 09:11

John Thomas


3 Answers

Try SSLBlackBox.

like image 71
Ondrej Kelle Avatar answered Nov 17 '22 09:11

Ondrej Kelle


TOndrey gave you a good answer. I use SecureBlackBox as well. You may consider some other third party components:

  • StreamSec
  • SecureBridge from DevArt
like image 37
Mihaela Avatar answered Nov 17 '22 10:11

Mihaela


Be aware: if you add SSL/TLS support inside your executable, it might become restricted for export. If you're in the USA, this could mean that your application cannot be sold or given to people outside the USA. This is why these DLL's aren't part of Indy or Delphi themselves.

The libraries that Delphi uses are actually compiled DLL's from the OpenSSL project. But if you have a good knowledge of C then you should be able to compile the source to .obj files and link them with your Delphi code instead. You would probably need to modify part of the Indy code for this too. Of course, others could have done this too, but that makes the export of those Indy components (or even Delphi itself) more complex, because of those export restrictions.

Funnily enough, source code is protected by the first amendment which basically allows you to print the code in a book and then send it to some rogue nation. While if you'd send it in digital form (compiled or not) then you're committing a federal offence and probably will have to be careful when picking up the soap in the shower for at least a year... No one claimed that laws make sense. They can just be a pain in the [beep]...

Other SSL solutions don't work together with the Indy components, which would mean you'd have to rewrite part of your code to support those other solutions.


This link tells how you can load a DLL from memory, so you don't need to have it on disk. It's an alternate solution which I haven't tried. I don't think it will work, since the two DLL's depend on each other, but it might be worth a try...
like image 3
Wim ten Brink Avatar answered Nov 17 '22 10:11

Wim ten Brink