Recent

Author Topic: https via httpget  (Read 3122 times)

vonskie

  • Full Member
  • ***
  • Posts: 184
https via httpget
« on: August 23, 2017, 08:26:59 pm »
It seems to  get https working via TFPHttpClient I have to install  openssl from https://slproweb.com/download/Win32OpenSSL-1_0_2L.exe,  is there a uses a statement that would avoid this requirement... seems like it should be built into one of the packages or something...




 

« Last Edit: August 23, 2017, 08:31:15 pm by vonskie »

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: https via httpget
« Reply #1 on: August 23, 2017, 08:31:51 pm »
You don't need to "install" the openssl.
You can also just put the correct DLLs in your project directory.
TFPHttpClient uses them automatically.

You can download the zip from
https://indy.fulgan.com/SSL/

For instance for a 32 bit program you can use
https://indy.fulgan.com/SSL/openssl-1.0.2l-i386-win32.zip
and for a 64 bit program you can use
https://indy.fulgan.com/SSL/openssl-1.0.2l-x64_86-win64.zip
(these are the latest at this moment)

You can extract that zip to your programs exe directory.

You could embed these DLLs into your program and extract them when needed but that's a bit more advanced.

Also note... there is also a http version of indy.fulgan.com at http://indy.fulgan.com/SSL so you could download the zip in your program itself with TFPHttpClient when the DLLs are not present and extract it before using TFPHttpClient with HTTPS :)

Final note... you could statically embed the openssl code in your program with then OpenSSLStaticLibs but I haven't tried that.
http://forum.lazarus.freepascal.org/index.php?topic=26947.0
« Last Edit: August 23, 2017, 08:44:46 pm by rvk »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: https via httpget
« Reply #2 on: August 23, 2017, 08:51:29 pm »
Final note... you could statically embed the openssl code in your program with then OpenSSLStaticLibs but I haven't tried that.
http://forum.lazarus.freepascal.org/index.php?topic=26947.0
I would like to add to that: think very hard before wanting to do that. Past issues have shown that it is basically bad practice to embed a specific version of ssl libraries inside your program. At least offer/create the possibility for end-suer to be able to 'override' the internal used version.

vonskie

  • Full Member
  • ***
  • Posts: 184
Re: https via httpget
« Reply #3 on: August 23, 2017, 09:26:03 pm »
Thank you I just configured NSIS to drop the DLL files you gave me a link to in the app dir and it worked!

Thank you!


 

TinyPortal © 2005-2018