Recent

Author Topic: SSL files location  (Read 2728 times)

torbente

  • Sr. Member
  • ****
  • Posts: 322
    • Noso Main Page
SSL files location
« on: January 22, 2022, 01:45:58 am »
Hi everyone;

I believe this is a pretty simple question, and i was unable to find nothing relative.

Using a TFPHttpClient...

It is mandatory to keep the SLL files on the same folder of our app? Or we can redirect its location, something like...

Code: Pascal  [Select][+][-]
  1. MyTFPHttpClient.SSLFiles.path:= Path; // Different from app path

Or maybe to resource files included in the app binary?

Thanks
« Last Edit: January 22, 2022, 03:09:26 am by torbente »
Noso Cryptocurrency Main Developer
https://github.com/DevTeamNoso/NosoWallet

PascalDragon

  • Hero Member
  • *****
  • Posts: 4018
  • Compiler Developer
Re: SSL files location
« Reply #1 on: January 23, 2022, 01:31:58 pm »
It is mandatory to keep the SLL files on the same folder of our app? Or we can redirect its location, something like...

What do you mean with “SSL files”? The libraries or the certificates?

torbente

  • Sr. Member
  • ****
  • Posts: 322
    • Noso Main Page
Re: SSL files location
« Reply #2 on: January 23, 2022, 01:36:12 pm »
It is mandatory to keep the SLL files on the same folder of our app? Or we can redirect its location, something like...

What do you mean with “SSL files”? The libraries or the certificates?

Libraryes: ssleay.dll and libeay.dll
Noso Cryptocurrency Main Developer
https://github.com/DevTeamNoso/NosoWallet

PascalDragon

  • Hero Member
  • *****
  • Posts: 4018
  • Compiler Developer
Re: SSL files location
« Reply #3 on: January 23, 2022, 01:40:30 pm »
You can determine their location by calling InitSSLInterface of the unit OpenSSL before using any SSL related functionality (at best as soon as possible in your main program). Please note that this should only really be necessary for Windows as other operating systems provide suitable default libraries.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 862
  • Professional amateur ;-P
Re: SSL files location
« Reply #4 on: January 23, 2022, 01:58:02 pm »
Hey PascalDragon,

You can determine their location by calling InitSSLInterface of the unit OpenSSL before using any SSL related functionality (at best as soon as possible in your main program). Please note that this should only really be necessary for Windows as other operating systems provide suitable default libraries.

The OP's question is if you can SET the location not how to GET the location.

He wants a tidy system and wants the App to be in a folder and the .dlls to be in AppFolder/SSL so it's all neat and organised.

He's asking if it's possible to provide an extra path in conjunction to the paths already in the PATH variable.

If so, then how?

If not, I'll undertake the task to console him of his grief :)

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.10 64b Dark Theme
http://github.com/gcarreno

PascalDragon

  • Hero Member
  • *****
  • Posts: 4018
  • Compiler Developer
Re: SSL files location
« Reply #5 on: January 23, 2022, 02:06:57 pm »
Hey PascalDragon,

You can determine their location by calling InitSSLInterface of the unit OpenSSL before using any SSL related functionality (at best as soon as possible in your main program). Please note that this should only really be necessary for Windows as other operating systems provide suitable default libraries.

The OP's question is if you can SET the location not how to GET the location.

determine was meant as a synonym of regulate or control and not retrieve. The function takes the paths to the two libraries to initialize the function imports. Thus torbente is able to control where the libraries should be placed. The remainder is up to them.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 862
  • Professional amateur ;-P
Re: SSL files location
« Reply #6 on: January 23, 2022, 02:16:13 pm »
Hey PascalDragon,

determine was meant as a synonym of regulate or control and not retrieve. The function takes the paths to the two libraries to initialize the function imports. Thus torbente is able to control where the libraries should be placed. The remainder is up to them.

Ooops, mea culpa, really sorry. I get it now!!

So I'm guessing that one of the params for InitSSLInterface will be the path to the libs.
Does this include the lib name's themselves o just a folder name to look them up?

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.10 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.10 64b Dark Theme
http://github.com/gcarreno

torbente

  • Sr. Member
  • ****
  • Posts: 322
    • Noso Main Page
Re: SSL files location
« Reply #7 on: January 24, 2022, 12:16:05 am »
Code: Pascal  [Select][+][-]
  1. determine was meant as a synonym of regulate or control and not retrieve. The function takes the paths to the two libraries to initialize the function imports. Thus torbente is able to control where the libraries should be placed. The remainder is up to them.

Hi @PascalDragon

Any working code example? Or a link to any previous related thread to give me a better idea?

Thanks a lot in advance...
Noso Cryptocurrency Main Developer
https://github.com/DevTeamNoso/NosoWallet

PascalDragon

  • Hero Member
  • *****
  • Posts: 4018
  • Compiler Developer
Re: SSL files location
« Reply #8 on: January 24, 2022, 01:47:50 pm »
Not tested, but should give you an idea:

Code: Pascal  [Select][+][-]
  1. program tssl;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   OpenSSL, SysUtils;
  7.  
  8. var
  9.   p: String;
  10. begin
  11.   p := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)) + 'Libs');
  12.   InitSSLInterface(p + 'ssleay32.dll', p + 'libeay32.dll');
  13.   // do something with SSL
  14. end.

 

TinyPortal © 2005-2018